Category: Linux

Upgrade Ubuntu to the Latest Version

Use these two commands to upgrade to the latest version of Ubuntu/other debian based distros. sudo apt-get update sudo apt-get…

Show Packages from a Group

Show rpm packages of a group software rpm -qg “System Environment/Daemons”

Trim Image Edge

Use this command to cut off the edges off an image… convert -trim image.jpg output.jpg

Find Link Files

Use this command to find all the links in the current directory… find . -lname “*”

help command

Use the help command to get information on built in command… help alias

Locate Files With Names Matching A Regexp

You can use locate to find files with name that matches a said regexp… locate -i -r ‘\.jpg$’

A Shell Scirpt to Mount ISO files

A Shell Scirpt to Mount ISO files – call it using the command moustiso.sh ImageFile.iso. You need a folder called…

Delete Leading Whitespace Using Sed

Delete leading whitespace (spaces/tabs/etc) from beginning of each line. Same as yesterday’s command – but using sed cat file.txt |…

Delete Leading Whitespace

Delete leading whitespace (spaces/tabs/etc) from beginning of each line ruby -pe ‘gsub(/^\s+/, “”)’ < file.txt

Find files of a specific mime-type

Use this command to find files of a given mime-type. In this example, we are looking for video files… find…