![]() By default df -k displays output in bytes. df command examplesĭisplays the file system disk space usage. More top examples: Can You Top This? 15 Practical Linux Top Command Examples 25. The following will show only the top processes that belongs to oracle user. To displays only the processes that belong to a particular user use -u option. Select sort field via field letter, type any other key to returnĪ: PID = Process Id v: nDRT = Dirty Pages countĭ: UID = User Id y: WCHAN = Sleeping in FunctionĮ: USER = User Name z: Flags = Task Flags To sort top output by any column, Press O (upper-case O), which will display all the possible columns that you can sort by as shown below. Top command displays the top processes in the system ( by default sorted by cpu usage ). ![]() ![]() If you want to see a total memory ( including the swap), use the -t switch, which will display a total line as shown below. b option displays in bytes, -k in kilo bytes, -m in mega bytes. If you want to quickly check how many GB of RAM your system has use the -g option. This command is used to display the free, used, swap memory available in the system. To view current running processes in a tree structure. While there are lot of arguments that could be passed to a ps command, following are some of the common ones. Ps command is used to display information about the processes that are running in the system. i.e Instead of calling the scripts located in the /etc/init.d/ directory with their full path, you can use the service command.Ĭheck the status of a service: # service ssh statusĬheck the status of all the services. Service command is used to run the system V init scripts. More crontab examples: Linux Crontab: 15 Awesome Cron Job Examples 21. */10 * * * * /home/ramesh/check-disk-space View crontab entry for a specific user # crontab -u john -l More ftp examples: FTP and SFTP Beginners Guide with 10 Examples 20. To view the file names located on the remote server before downloading, mls ftp command as shown below. To connect to a remote server and download multiple files, do the following. # shutdown -Fr nowīoth ftp and secure ftp (sftp) has similar commands. # shutdown -r nowįorce the filesystem check during reboot. Reboot the system using shutdown command. Shutdown the system and turn the power off immediately. View the contents of *.zip file (Without unzipping it): $ unzip -l jasper.zipĤ0995 11-30-98 23:50 META-INF/MANIFEST.MF To extract a *.zip compressed file: $ unzip test.zip More bzip2 examples: BZ is Eazy! bzip2, bzgrep, bzcmp, bzdiff, bzcat, bzless, bzmore examples 17. To create a *.bz2 compressed file: $ bzip2 test.txt To uncompress a *.gz file: $ gzip -d ĭisplay compression ratio of the compressed file using gzip -l $ gzip -l *.gzĬompressed uncompressed ratio uncompressed_name To create a *.gz compressed file: $ gzip test.txt More cd examples: 6 Awesome Linux cd command Hacks 15. Use “shopt -s cdspell” to automatically correct mistyped directory names on cd Use “cd -” to toggle between the last two directories What else can be said about the good old pwd who has been printing the current directory name for ages. More ls examples: Unix LS Command: 15 Practical Examples 13. Visual Classification of Files With Special Characters Using ls -F $ ls -F Order Files Based on Last Modified Time (In Reverse Order) Using ls -ltr $ ls -ltr # find / -name *.jpg -type f -print | xargs tar -cvzf ĭownload all the URLs mentioned in the url-list.txt file # cat url-list.txt | xargs wget –cĭisplay filesize in human readable format (e.g. Search all jpg images in the system and archive it. find command examplesįind files using file-name ( case in-sensitve find) # find -iname "M圜Program.c"Įxecute commands on files found by the find command $ find -iname "M圜Program.c" -exec md5sum /external-hard-drive/directory More grep examples: Get a Grip on the Grep! – 15 Practical Grep Command Examples 3. Search for a given string in all files recursively $ grep -r "ramesh" * Print the matched line, along with the 3 lines after it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |