Free and Open Education
Free and Open Education

Basic Command Of Linux for Mastering Linux Command line.

In this post, you will learn some basic Linux command towards your journey of Linux mastery.

whoami (Print effective user id)

Brief Contents

whoami
whoami displays the user id kali

For more information on whoami kindly refer to man page of whoami.

ls (This linux command displays infomation about files.)

ls -a /etc
This command includes all hidden filesnames
ls -ld /etc
This displays directory information without displaying their content
ls
displaying directory information without content
ls -l /etc
This command diplays the files in  long listing format

ip a (Displays the IP address of the interface of the system)

ip
ip addr command

cat (Display the content of text file)

cat linux command
cat command

passwd (This command changes the password of the user)

passwd
passwd command changes the password of the user

touch linux utility (It changes the file modification and access time)

touch file1
This command create a file named file1
touch -d "05 June 2022" file2
This command create a file named file2 habing time stamp of June 05 

cp command utility (This command is used to copy one or more files)

cp file1 file2      
This command copy the content of file "file1" to "file2"
cp
cp command copies content of one file to another
cp -i file1 file2     
This command ask for confirmation for overwrite while copying file "file1" to existing file "file2"  

mkdir (This command is used to create directory)

mkdir dir1
This command create a directory named dir1
mkdir -p newdir/dir2
This command create both the directory named "newdir" and "dir2" 
mkdir linux utility
mkdir command create a directory named dir1

rmdir (This command deletes a directory)

rmdir
rmdir command deletes the blank directory

mv (command to rename or move a file)

mv file1 file2 
This command  renames the filename of "file1" as "file2"
mv
Rename the filename or move to a different directory using mv command
mv file2 dir
This command moves the file "file2" to directory dir
mv linux command
mv command moves the file “file2” to directory dir

rm (This linux command removes a file)

rm -r dir
Recursively delete the content of the directory specified including the sudirectories.
rm -r command
rm -r command
rm -f dir
Forcefully removes a file

These were some of the basic linux command now for mastery you have to practice as practice makes a person perfect.

For more such Linux guide kindly visit Tuxstudy.

Leave a comment

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