Pages

atas horizontal

April 04, 2011

basic command line on linux

Twitter Facebook Digg Delicious Lintas Berita
I am sure that many articles contains about the basic commands in linux, but I wanted to write it again because certainly there are many new Linux users who still do not understand about the basic commands in linux.
Some basic commands in linux terminal which is often used, among others:


1. Displaying directory contents
ls     Displaying directory contents
ls-R 
Displaying directories and their contents
ls-m
Displays files with comma separator
ls-x 
Showing files horizontally
ls-a 
Displays all files, including hidden files
ls *. txt
Displays files with a specific type, ex = txt (text file)
ls-F 
Displays for the directory
ls-l    Displays file with permission files
ls-color Displaying files and directories with a different color

2. Moving directory
cd / usr / bin
Move to the directory / usr / bin
cd ../..
Move to root directory
cd or cd -
Move to the beginning of the directory
3. Finding files
find / usr-name-print text1.txt
Finding a file a.txt in the directory / usr
find / usr-name '*. txt'-print
Finding all the txt files in the directory / usr
find / mnt / dos-name *. sys-print-xdev
Finding files with the O / S Windows
find /-name *. txt-print
Finding all the txt files starting from root

4. Create a new file

fileku touch the contents of the file ... ... ctrl + d 
Create a new file with the name fileku
cat> fileku contents of the file ... .... ctrl + d
Create a new file with the name fileku

5. Knowing the type of file

file / usr / bin / aa know what kind of aa file in the directory / usr / bin

6. Displays the contents of the file
more dataku.txt
Displays the contents of the file dataku.txt
cat / dir / dataku.txt
Showing dataku.txt file in the directory / dir
less dataku.txt
Displays the contents of the file dataku.txt

7. Copying files and directories
cp data1 data2
Copying files data1 to the file data2
data1 cp / data
Copy the file data1 to the directory / data
data1 data2 cp dir /
Copy the file data1 to data2 file in the directory / dir

8. Renaming files
mv data1 data2
Changing the file name with a new name data2 data1

9. Transferring files
mv data1 data/01
Transferring files data1 to the directory / data/01

10. Deleting files and directories
rm data1
Deleting file data1
rm data/01
Delete the contents of the directory / data/01
rm data *
Delete all files that start with the name data
rmdir / data/01
Deleting directory / data/01

11. Create a directory
mkdir data
Creating directory data
mkdir data1 data2 Creating directory  data1 and data2
mkdir-p / data/01
Create a directory / data/01 well

12.Logout, Turn off and Restart the Computer
halt
shutdown Computer
reboot
restart Computer
logout
Logout of active users

1 comment: