1) Tail: Displays Last 10 Lines From Ending: Syntax: $ Tail File-Name
1) Tail: Displays Last 10 Lines From Ending: Syntax: $ Tail File-Name
1) Tail: Displays Last 10 Lines From Ending: Syntax: $ Tail File-Name
a) Read : 4
b) Write : 2
c) Execute : 1
Syntax : $ top
Syntax : $ who
Syntax : $ who am i
DISK COMMANDS :
1) du : Gives amount of disk space usage
2) $du sh file/dir
----> Gives the size of the file/dir
LS COMMANDS :
2) ls -ltr : List the files in directory with the Newest files last.
COMPRESS COMMANDS :
PROCESS COMMANDS :
3) ps -ef | grep java | wc -l : To show how many java processes are running on system.
SEARCH COMMANDS :
1) Find : The find command is used to find the files in the hard drive.
2) Locate : The locate command is much faster than the find command.
-----> Finding a file using locate is faster when compared to the find command
Example : $ locate
A) VERSION 5.0
A) -l shows you huge amounts of information (permissions, owners, size, and when last
modified.)
-r reverses the order of how the files are displayed.
-t shows you the files in modification time
A) Ps -grep
Q) How to check the multiple NIC in Unix or linux? (NIC NETWORK INTERFACE CARD)
A) ifconfig -a
A) ps -ef
-atime +7: All files that were last accessed more than 7 days ago
-atime 7: All files that were last accessed exactly 7 days ago
-atime -7: All files that were last accessed less than7 days ago
Q) Display list of all files in /home directory that were not last modified less than then days ago.
A) -mtime +60 means you are looking for a file modified 60 days ago.
-mtime -60 means less than 60 days.
-mtime 60 If you skip + or - it means exactly 60 days.
Q) search for just files that have been modified in the last seven days ?
Q) search for just directories that have been modified in the last seven days ?
Q) you want to search the "/tmp" directory instead of the current directory for files modified in the
last three days ?
Q) find a file or directory that has been modified in the last seven days ?
A) find . -mtime -7