Sei sulla pagina 1di 4

Here's A List Of 83 Linux Commands For Beginners!

Switching to Linux was a wonderful decision, now it's time to explore its
power - the command line!
So you have just switched to Linux and trying to figure out what was the fuss about the command prompt as
the most powerful tool. Well here's a list of Linux commands for a beginner to help you get a glimpse of what
the command prompt can do for you.
Viewing, coping, mo!ing and de"eting fi"es
"s Display the contents of the current directory
"s #a Display also hidden files and hidden directories
cp fi"ename $pat%$dir&name Copy filename into directory pathdir!name
cp #r dir&name $pat%$dir&name' Copy the entire dir!name into pathdir!name"
cp fi"ename( fi"ename'
$pat%$dir&name
Copy filename# and filename" into pathdir!name
rm name $emove a file or directory called name
rm #r name
$emove an entire directory as well as its included files
and subdirectories
m! fi"ename $pat%$dir&name %ove filename into pathdir!name
m! fi"ename( fi"ename' $ename filename# to filename"
cat fi"ename Display filenames contents
more fi"ename
Display filename in pages. &se spacebar to view next
page
%ead fi"ename Display filenames first #' lines
%ead #() fi"ename Display filenames first #( lines
tai" fi"ename Display filenames last #' lines
tai" #() fi"ename Display filenames last #( lines
pwd Display current directory
cd $pat%$dir&name Change to directory pathdir!name
cd ** )o # directory up
m+dir dir&name Create directory dir!name
rmdir dir&name Delete directory dir!name
Finding fi"es and text wit%in fi"es
updated,
&pdate *create first time used+ a database of all files under the root
directory
"ocate fi"ename ,ind file filename searching in the database
find $ #name fi"ename Starting from the root directory search for the file called filename
find $ #name -fi"ename Same as above but search for file containing the string filename
grep string
$pat%$dir&name
Starting from pathdir!name search for all files containing string
w%ic%
app"ication&name
Search -path for application app!name
w%ereis
app"ication&name
Search -path. man pages and source files for application!name
Arc%i!ed fi"es
.ecompress
tar #x/f fi"ename*tg/ Decompress t/g file
tar #x/f fi"ename*tar*g/ Decompress tar.g/ file
tar #x0f fi"ename*tar*,/' Decompress tar.b/" file
Compress
tar #c/f fi"ename*tar $pat%$dir&name Compress directory pathdir!name to filename.tar
g/ip #c fi"ename 1 fi"ename*g/ Compress pathdir!name to filename.tar.g/
,/ip' #c fi"ename 1 fi"ename*,/' Compress pathdir!name to filename.tar.b/"
2sing rpm fi"es
rpm #%i! pac+age*rpm 0nstall rpm called pac1age.rpm
rpm #%i! ##force pac+age*rpm 0nstall rpm called pac1age.rpm by force
rpm #%2! pac+age*rpm &pgrade rpm called pac1age.rpm
rpm #e pac+age*rpm Delete rpm called pac1age.rpm
rpm #3pi" pac+age*rpm List files in not2installed rpm called pac1age.rpm
rpm #3" pac+age*rpm List files in installed rpm called pac1age.rpm
rpm #3 str List installed rpms containing the string str
rpm #3f
$pat%$app"ication&name
Display the rpm that contains application application!name
4tarting and 4toping
startx Start the 3 system
s%utdown #% now Shutdown the system now and do not reboot
%a"t Same as above
s%utdown #r now $eboot
re,oot Same as above
s%utdown #r 5(6 $eboot in #' minutes
7ounting fi"esstems
mount #t !fat $de!$sd8a9
8(9 $mnt$c&dri!e
%ount the first partition # of the first hard dis1 drive a which is in
fat4" vfat dormat under mntc!drive directory
mount #t iso:;;6
$de!$cdrom $mnt$cdrom
%ount cdrom under mntcdrom directory
umount $mnt$%da( &nmout the above
2ser administration
users Display users currently logged in
adduser username Create a new user called username
passwd username Define password for user called username
w%o List logged2in users
w%oami Display current user
finger username Displays info about user username
su Log in as root from current login
su # Log in as root from current login and ta1e root's path
exit 5xit from console login *ie. logout+.
<rocesses
command 5xecute command in the foreground
command = 5xecute command in the bac1ground
ctr"5/ Suspend a program
ctr"5c 0nterrupt a program
ps List all processes
+i"" #: pid 6ill process with id pid
top %onitor processes in real time
>etwor+ing
%ostname List the system's hostname
ifconfig SetDisplay networ1 information
%ost ip $esolves ip's hostname
ping ip$%ostname Chec1 if iphostname is reachable
traceroute ip$%ostname ,ind networ1 path to iphostname
4stem ?nformation
uname #a )eneral system information
fdis+ #" List partition tables
cp fi"ename $pat%$dir&name Copy filename into directory pathdir!name
df #@ #% List filesystem dis1 space usage
"spci List 7C0 devices
"sus, List &S8 devices
free #m Display $9%:Swap usage
<rogram Compi"e
gcc #o output fi"e*c Compile a C program
*$output $un a C program you have compiled
g55 #o output fi"e*cpp Compile a C:: program
*$output $un a C:: program you have compiled
*$configure == ma+e == su #c 'ma+e
insta""'
Configure. compile and install a program with
%a1efile