Unix Commands Cheat Sheet
Below is a cheat sheet of Unix commands that are useful for Linux server administration.
|
|
Unix Cheat Sheet
Below is a cheat sheet of Unix commands that are useful for Linux server administration. This is by no means an exhaustive list, however it is very useful for beginners. These commands were used on my server running Debian 6.0.
ls – list the contents of the directory you’re in
ls -a – list the contents of the directory you’re in (including hidden files)
ls -l – shows you file permissions and ownership
cd – change directory
cp – copy
scp – secure copy
chmod – change permissions
chown – change the owner of a file
/ – top level directory
Tab key – autocomplete words
pwd – tells you what directory you are in
echo – echo argument
grep – search file
wc – count characters/words/lines
up arrow – shows your previous commands
mkdir (directory name) – make a new directory with the name given
rm -R (directory name) – delete directory
cd ../ – move up a directory in the file system (parent directory)
touch (filename) – create file
nano (filename) – create file using nano command line text editor
cat – view the contents of a text file.
more – view the contents of a text file, allows you to view by page (spacebar to move to the next page)
rm (filename) – delete file
rm *.(filetype) – delete all files of a specified type
rmdir – remove directory
apt-get update – updates the package cache
apt-get upgrade – upgrading packages
apt-get dist-upgrade – upgrades the kernel etc.
apt-get install (package name e.g. nano) – install package
&& – join commands together
^ – symbol is Ctrl (called the caret)
Ctrl + C – cancels the command
wget (filename/link to a filename on the internet) – downloads the file/package specified
logout – logout
reboot – reboot
sudo logout – logout (only needs sudo if a non root user)
sudo reboot – reboot server (only needs sudo if a non root user)
su – – logs in as root if already logged in as a non root user
rwxr-xr-x – file permissions shown as: read, write, execute. Shown for owner, group and user
Commands for Server Optimisation
top – displays real time CPU processes and resources being used by CPU-intensive tasks
apt-get update – Updates the cache on local machine so it is aware of what files the Linux repository has got, and where they are.
apt-get upgrade – Applies the changes/updates that are available in the update command.
free -m – Show you the RAM memory usage at any specific time. (-m shows it in megabytes)
uname -r – Shows the kernel version.
uname -a – Shows what kernel version is running, more about the operating system, whether 64-bit or 32-bit and what processor you are using.
cat /etc/lsb-release OR
cat /etc/issue OR
ls -l /etc/system-release – Find out what distribution your running and what version.
df -TH – Find out how much hard disk space is being used. Full Story |
This topic does not have any threads posted yet!
You cannot post until you login.