Linux Basic Commands Updated
Linux Basic Commands Updated
Command
ls
Usage
ls /directory_path
Description
List files
eg: ls /usr/lib
cp
cp file_path /destination_directory_path
Copy files
eg: cp student /home/cloudera/Desktop
mv file_path
/destination_directory_path
mv
eg: mv myfile.txt /newdirectory
mv current_filename new_filename
eg: mv computer.txt computer_hope.txt
rm file_path
rm
Delete files
eg: rm /home/cloudera/Desktop/file_name
ln file_path /destination_directory_path
ln
Link files
eg: ln student /home/cloudera/Desktop
cd /Directory_path
Change directory
cd
eg: cd /usr/lib/Hadoop-0.20
pwd
pwd
Command
Usage
Description
mkdir /new_directory_path
mkdir
eg: mkdir
/home/cloudera/Desktop/new_directory
Create directory
rmdir /directory_path
rmdir
eg: rmdir
/home/cloudera/Desktop/directory
Delete directory
cat /file_path
cat
View files
eg: cat /home/cloudera/file_name
nl /file_path
nl
Number lines
eg: nl studentRoll
vi /file_path
vi
Text Editor
eg: vi studentRoll
stat /file_path
stat
Display file
attributes(properties)
wc /file_path
wc
Count bytes/words/lines
eg: wc studentRoll
Command
Usage
Description
ifconfig
ifconfig
Set/display network
information/ Ip address