Basic Linux Commands
Command Usage Description
ls
ls /directory_path List files
eg: ls /home/edureka
cp cp src_file_path
/destination_directory_path Copy files
eg: cp student /home/edureka/Desktop
mv src _file_path
/destination_directory_path Renames a file or moves
mv it from one directory to
eg: mv myfile.txt /newdirectory another directory
mv current_filename new_filename
eg: mv computer.txt computer_hope.txt
rm file_path
rm Delete files
eg: rm /home/edureka/Desktop/file_name
ln file_path /destination_directory_path
ln Link files
eg: ln student /home/edureka/Desktop
cd /Directory_path Change directory
cd
eg: cd /home/edureka/Desktop
pwd pwd Print current directory
name or Present Working
Directory
Command Usage Description
mkdir /new_directory_path
eg: mkdir Create directory
mkdir /home/edureka/Desktop/new_directory
rmdir /directory_path
rmdir
eg: rmdir Delete directory
/home/edurekaDesktop/directory
cat /file_path
cat View files
eg: cat /home/edureka/file_name
nl /file_path
nl Number lines
eg: nl studentRoll
gedit /file_path
gedit Text Editor
eg: gedit studentRoll
stat /file_path Display file
stat attributes(properties)
eg: stat studentRoll
wc /file_path
wc Count bytes/words/lines
eg: wc studentRoll
Command Usage Description
chown user_name file_path
chown eg: chown edureka Change file owner
/home/edureka/Desktop/README.txt
chgrp group_name /file_path
chgrp eg: chgrp admin Change file group
/home/edureka/Desktop/README.txt
ifconfig ifconfig Set/display network
information/ Ip address
sudo chattr +i/-i /file_path
chattr Change advanced file
eg: sudo chattr +i attributes
/home/edureka/Desktop/README.txt