Linux 1 – Basic Linux Command



ls – List files in a directory
Result – Documents Downloads Music Pictures Videos

ls -a –> give hidden file as well

touch abc.txt –> create new file with touch

nano abc.txt or vm abc.txt –> for creation of files

ls -l – list of files with details like what permission is given.
Result – total 12

drwxr-xr-x 2 azureuser azureuser 4096 May 15 10:15 Documents

-rw-r–r– 1 azureuser azureuser 312 May 14 16:20 file.txt

-rwxr-xr-x 1 azureuser azureuser 1024 May 13 11:45 run.sh

Note – better human readable ke liye we can use ls -lh


ps aux – give list of all running process in machine.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root 1 0.0 0.1 22536 3080 ? Ss 10:00 0:01 /sbin/init

azureuser 1356 0.1 1.2 112856 24500 pts/0 Ss 10:35 0:00 -bash

azureuser 1420 0.2 0.5 45632 10324 pts/0 R+ 10:36 0:00 ps aux

Similar to above pstree give hirarichal views.

Echo command
echo “Hello, Butterfly!” –> print Hello, Butterfly!

Convert to base64

echo -n “Hello, Butterfly!” | base64
result – SGVsbG8sIEJ1dHRlcmZseSE=

Decode from Base64

echo “SGVsbG8sIEJ1dHRlcmZseSE=” | base64 –decode
Results – Hello, Butterfly!


Head abc.txt –> give first 10 lines on screen so you get idea what this file about
Generally use to check configuration

Tail abc.txt –> give last 10 lines to know latest update.
Generally use to check logs of file

Leave a Comment

Your email address will not be published. Required fields are marked *