Man - Online manual page for Linux Command. Apropos- Search the command short description with the given keyword . CD- Changing the current current description to some destination directory. ls - List Directiries and Files...
1. Man – Online Manual Page for Linux Commands
- Displaying Manual or Help Page
# man find
- Getting Short Description
# man -f ifconfig
- Getting List of commands using keyword
# man -k “network”
- Converting Manual Page into Portable Format [ Text , PDF , PS ]
- For Text File conversion# man ls | col -b > lstext.txt
- For PDF or PS conversion# man -t ls > lsps.ps# man -t ls | ps2pdf – > lstext.pdf
2. apropos - search the command short description with the given keyword
- General Syntax
#apropos “print”
- Pattern Matching
#apropos -r “^[p]+[g]$”
[This pattern will match the command description word
starting with "p" and ends with "g" ]
3. cd – changing the current directoy to some destination directory
# pwd [ Current Working Directory]
# cd /opt/ [chnage to /opt]
# cd .. [ change to root]
4. ls - List Directories and Files
# ls [ display all files and folders ]
# ls -l [ display files with all information ]
# ls -a [ display hidden files also ]
# ls -R [ display the folder contents ]
# ls -i [ display the index number of each file ]
5.cp – copying folders and files from source to destination.
- 5.1 Copying Files
# cp kavidhai.pdf /opt/
[copy the file kavithai.pdf into /opt folder]
# cp kavidhai.pdf sam.txt /opt/
[copy the files kavithai.pdf and sam.txt into /opt folder ]
- 5.2 Copying Folders
# cp -r uploads/ /opt/
[Copy the folder uploads and its content into /opt folder]
6. rm – delete files and folders
# cd /opt/uploads
# rm kavidhai.pdf
[Delete kavithai.pdf from uploads folder ]
# cd ..
# rm -r uploads/
[Delete the folder uploads/ and its content from /opt]
7. cat - create ,display and concatenate the file (s)
7.1 Create new file
# cat > sample.txt
Hello
[This syntax will create new textfile you can use ctrl+c
for saving and exit from the editor. ]
7.2 Dispaly the file contents [Read Only]
#cat sample.txt
Hello
7.3 Concatenating Files
# cat > sample1.txt
Welcome to OpenPeata
^C
# cat sam.txt sample1.txt
Hello
Welcome to OpenPeata
8. history – User commands in terminal will be stored into hitory configuration file.
# history | tail -2
48 cat > sam.txt
49 cat sam.txt
[This command displays last 10 histories, to display entire history type only history command (#history)]
#history -c [Clears all history ]
9. find – search for files in a directory
# find /opt -name “eclipse”
[This command will search the files and folders contains the name 'eclipse' in /opt directory]
10. tar - Cretae Append , Delete , Extract the archive files
#tar -cf my.tar a.txt b.txt [Create my.tar from files ] a.txt and b.txt.
#tar -tvf my.tar [List all files in my.tar]
#tar -xf my.tar [ Extract all files from my.tar]
#tar -xzvf eclipse.tar.gz [ Extract tar.gz file]
#tar -xjvf octave.tar.bz2 [Extract tar.bz2 file]
No comments:
Post a Comment