Powerfull Linux/Unix Shell Commands

terminal

Listing Files And Directories
1. ls (list directory contents)
2. ls -l (long listing format)
3. ls -al (long listing format with hidden files)
4. ls -R (list subdirectories recursively)
5. ls -alR
6. ls -alh (human readable form)
7. l. (shows only hidden files)
8. ll
9. ls -i (print inode/index number of each file)
10. dir
11. vdir
12. ln -s (make soft links between files, no diskspace used, can cross partitions, orphaned if parent deleted, same inode as parent )
13. ln (create hard links betw files, uses disk space, can’t cross partitions, retains data if parent is deleted but still same inode)
14. namei (follow a pathname until a terminal point is found – i.e. the parent of a symlink ad infinitum)
15. namei -m
16. namei -x
17. wc
18. wc –l
19. wc –w
20. wc –b
21. wc –c
22. ls -l | wc -l
Config Files
1. /etc/DIR_COLORS
Working With Files And Directories
CREATING/DELETING/RENAMING/COPYING/CHANGING FILES AND/OR DIRECTORIES
23. touch (to create a empty file or change file timestamps)
24. pwd
25. cp
26. cp -i
27. cp –a
28. cp –dpR (similar to above)
29. rm
30. rm -i
31. rm –f (remove files without asking for confirmation)
32. mv (move or rename files or directories)
33. mv -i
34. mkdir (make directories)
35. mkdir -p (make parent directories)
36. mkdirhier (similar to above)
37. rmdir
38. rm –fr (remove files and directories forcefully and recursively without warning)
39. cd dir
40. cd -> Return home
Date And Time
41. date (date –set “mm/dd/yy”)
42. redhat-config-date [X]
43. redhat-config-time [X]
44. hwclock (shows or sets the hardware CMOS clock – hwclock – -set – –date=”mm/dd/yy”
45. hwclock – -hctosys (updates the system clock. From the CMOS clock)
46. cal (displays a calendar)
47. gcalc [X]
48. kcalc [X]
49. timeconfig (Set locale)
50. uptime (Tells how long the system has been running until last reboot.)
Archiving Utilities
51. tar –cvf .tar file-list-to-archive
52. tar –xvf .tar
53. tar –tvf .tar
54. tar –zcvf .tar.gz file-list-to-archive
55. tar –zxvf .tar.gz
56. tar –ztvf .tar.gz
57. tar –jcvf .tar.bz2 file-list-to-archive
58. tar –jxvf .tar.bz2
59. tar –jtvf .tar.bz2
60. cpio
2
Compression Utilities
61. compress
62. uncompress
63. gzip
64. gzip –d
65. gunzip (same as above)
66. bzip2
67. bunzip2
68. zip
69. unzip
70. crypt
71. encrypt
Getting Help
72. info (Read documentation in Info format.)
73. man (display the online manual pages)
74. man -a (display all the manual pages)
75. whatis (search the whatis database for complete words.)
76. makewhatis
77. apropos (search the whatis database for strings)
78. command –help
79. whereis
Config Files
2. /usr/share/man/man1 ….. /usr/share/man/man9
3. /usr/share/doc/*
4. /etc/man.config
5. /var/cache/man/whatis
Finding And Searching
68. locate
69. updatedb
70. slocate
71. find
72. which
73. whereis
Config Files
6. /var/lib/slocate/slocate.db
Basic Commands
74. clear (clear the terminal screen)
75. alias
76. unalias
77. exit
78. logout
79. login
80. bash
81. ^d
82. history (recently accessed commands)
83. tty (Print the file name of the terminal connected to standard input.)
84. echo (display a line of text)
85. file (determine file type)
86. logname (print user´s login name)
87. runlevel (find the current and previous system runlevel.)
88. stty (print terminal settings)
89. stty -a (print all terminal settings)
90. reset (reset terminal initialization)
91. dmesg (used to examine or control the kernel ring buffer.)
92. klogd
93. uname (prints the kernel name.)
94. uname -r (prints the kernel version)
95. uname -a (prints all the system information)
96. mkbootdisk (creates a boot floppy for the running system)
97. sync (flush filesystem buffers)
98. free
99. fc
100. write
101. wall
3
102. mesg
103. mesg n
104. mesg y
105. mc
106. bc
107. source
108. tree
109. tree -d
110. ntsysv (Change bootup services)
111. ntsysv – -level 5
112. redhat-config-services [X]
113. redhat-config-language
114. su (Substitute User)
115. su -
116. su –username
117. sudo
Config Files
7. /root/install.log
8. /etc/sudoers
Working with Text Files
118. pr (convert text files for printing/print preview)
119. less
120. more
121. cat (concatenate files and print on the standard output)
122. grep (print lines matching a pattern)
123. grep -I (global regular expression print – Pattern scanning and searching)
124. grep -n
125. grep -c
126. egrep
127. fgrep
128. head (Shows first 10 lines of a text file)
129. head -5 (Shows first 5 lines of a text file)
130. tail (Shows last 10 lines of a text file)
131. tail -5 (Shows last 5 lines of a text file)
132. tail -f (Shows text file and freshening in real-time)
133. script
134. ispell check (Spelling checker)
135. nl (Number lines)
136. sort –r
137. sort -n
Working with Text Files – Some More ….
138. awk 139. gawk 140. cmp 141. column
142. comm 143. diff 144. diff3 145. enscript
146. eqn 147. expand 148. fmt 149. fold
150. fortune 151. groff 152. gs 153. join
154. look 155. md5sum 156. nroff 157. od
158. paste 159. pdf2ps 160. pdf2tptext 161. ptx
162. rev 163. sdiff 164. strfile 165. split
166. strfile 167. sum 168. tac 169. tr
170. troff 171. unexpand 172. uniq 173. unstr
174. zcat 175. zcmp 176. zdiff 177. zegrep
178. zfgrep 179. zgrep 180. zmore
Linux Editors
181. pico (simple text editor in the style of the Pine Composer)
182. mcedit (Full featured terminal text editor for Unix like systems.)
183. vi (VI IMproved, a programmers text editor)
184. joe (Joe’s Own Editor)
185. emacs
4
Adding / Deleting / Modifying Users – User Administration
186. adduser Create a new user)
187. useradd
188. passwd (To change password)
189. mkpasswd
190. pwgen
191. redhat-config-rootpassword
192. userdel (Delete a user)
193. userdel -r (Delete a user account and related files)
194. userconf (Deprecated)
195. redhat-config-users [X] )
196. usermod
197. users
198. id (print real and effective UIDs and GIDs)
199. id -u
200. id –g
201. chfn
202. chsh
203. vipw (edit the passwd files/prompts for change to shadow file also)
204. pwconv
205. pwunconv
206. pwck
Config Files
9. /etc/passwd – Disable a single user with “ * ”
10. /etc/shadow
11. /etc/group
12. /etc/gshadow
13. /etc/login.defs
14. /etc/default/useradd
15. /etc/shells
16. /etc/skel
17. /etc/nologin
18. /etc/securetty
Adding / Deleting / Modifying Groups – Group Administration
207. groupadd
208. groupmod
209. groupdel
210. groups
211. vigr
212. grpconv
213. grpunconv
214. grpck
File And Group Permissions
215. chmod ugo, rwx, -R
216. chown
217. chgrp
218. umask
219. Explain setuid, setgid, sticky – Ss, Tt, 1,2,4
Working With Floppies And Cdroms
220. eject
221. eject -t
222. mount
223. umount
Config Files
19. /etc/fstab -
5
Process/Environment/Job Control
224. & 225. bg
226. fg 227. jobs
228. suspend or ^Z 229. nohup ( Ignoring hangup signals even logouts. Must end in &)
230. kill -9 or ^C (sends signal to terminate process surely) 231. w (Show who is logged on and what they are doing.)
232. who (Show who is logged on) 233. whoami (Print the user name)
234. finger (Displays info about the system users.) 235. who am i
236. kill 237. kill -9
238. killall 239. nice –n priority PID (Alter priority H: -20 L:19 Def: 10)
240. renice priority PID (Alter priority of running processes) 241. printenv
242. env (Shows environment variables) 243. export
244. top (Display top CPU processes) 245. gtop (X) (Deprecated)
246. readonly (Make a shell variable readonly) 247. unset
248. pidof (Find the process ID of a running program) 249. ulimit -a
250. ulimit -S 251. ulimit -H
252. ulimit -f 253. ulimit -u
254. ulimit -v 255. ps (process status)
256. ps -el (display process status for everything in long format.) 257. ps -ef
258. ps -aux 259. ps –ux
260. ps -xxxx 261. ps -t tty1
Config Files
20. /etc/fstab
Shutting down and Halting your System
262. halt
263. poweroff
264. shutdown
265. shutdown –t secs –h now
266. shutdown –t secs –r now
267. shutdown +5 -h
268. shutdown +5 -r
269. shutdown -c
270. shutdown -a
271. reboot
272. init 1,2,3,4,5,6,0

Config Files
21. /etc/shutdown.allow
22. /etc/fstab
Checking Disk Space and Usage
273. df (report filesystem disk space usage)
274. df -h (print sizes in human readable format)
275. df -i
276. fdisk -l (Partition table manipulator)
277. du
278. du -sh (Summarize disk usage )
279. e2label (Change the label on an ext2 filesystem)
Linux Shells
280. bash 281. sh 282. csh 283. chsh
Linux Web Browsers
284. lynx
285. links
286. netscape (X)
287. konqueror (X)
288. opera (X)
289. mozilla (X)
Email Clients
290. pine 291. mutt 292. kmail 293. mozilla
294. Ximian Evolution
295. balsa

Source/credits::ashishtalokar

For Bash Shell Scripting download the sample book below

bash-shell

Author:steve-parker

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 213 other followers

%d bloggers like this: