This post – Part 2 – provides practical examples for frequently used commands in Linux / UNIX systems.
This is not a comprehensive list by any means, but this should give you a jumpstart on some of the common Linux commands. Bookmark this article for your future reference.
The command list is:
Login to remote host
# ssh -l ruben remoteserver.yourhost.com
Debug ssh client
# ssh -v -l ruben remoteserver.yourhost.com
pwd command means Print Working Directory. This command print the current directory name.
The who command prints information about all users who are currently logged in.
head command, by default, prints the first 10 lines of each FILE to standard output. head also reads from standard input.
sed command, short for “stream editor”, allows you to filter and transform text. When you copy a DOS file to Unix, you could find \r\n in the end of each line.
This example converts the DOS file format to Unix file format using sed command.
# sed ‘s/.$//’ your_file
Print file content in reverse order
# sed -n ‘1!G;h;$p’ your_file.txt
And that’s it.
Check Part 3 for more commands here.