Important Unix Commands That You Should Know
Unix is one of the most important operating system today. Its powerful features, scalability, strong security, and support for multiple users have made it the top choice operating systems for server, workstations and mainframes.
It is good to have some knowledge of Unix commands especially if your web host is Unix / Linux based. You could do a lot of things by yourself by logging into the server via Secure Shell (SSH). This article will describe some of the important "need to know" Unix commands.
This command will show you what files are in your current directory. If you add in a -F option, ie "ls -F xxx", there will be a "/" appended to the end of directory names, * to executables and @ to links. "Ls -a xxx" will display all hidden files as well. This is also the most used command.
Change directory. If you type "cd xx", it means to change to the specified directory "xx". "Cd ~" means to change to your default home directory.
3. cp "ab"
Copy file a to b. If b is a directory, the new file will be named b / a.
4. mv "ab"
Move files from a to b. For example, if I type "mv songs.txt / tmp", the file songs.txt will be moved to /tmp/songs.txt. Moving a file is the same as renaming a file.
5. echo "text"
Print "text" to the terminal. If "text" is surrounded by double quotes, the text will be printed with any environment variables such as $ HOME. If "text" is surrounded by single quotes, the "text" is printed without any special processing.
Print the current working directory. Useful command when you are lost in the directories.
7. cat "file"
Print the contents of the specified file (s) to the terminal.
8. less "file"
Display the specified file one screen at a time. Press the spacebar to go to the next screen. Press Q to quit. You often combine "less" with some other commands such as "cat abc | less". This command means you print the contents of the file abc and display it one page at a time.
Display information about your running programs. This is a good command to use if your server is slow and you suspect that some applications are taking too much memory. The most famous command using ps is "ps aux". This will display useful information on the running programs.
Remove or delete a file. If you type "rm -r directory", it will remove a directory and all the files underneath it recursively.
This is the most important command. man means "manual". If you are stuck with cat command for example, type "man cat" and you can see the help file.