How to use the command line to change GTK settings easily.

The settings used by the file chooser in MATE or Gnome can be changed easily with the command line. The gsettings utility makes this easy. This example will alter the Firefox file chooser, it will have directories listed first, in descending order, sorted by date modified. gsettings set org.gtk.Settings.FileChooser sort-column…

Read More

How to use rsync to list filenames in a directory on a remote Linux server.

The rsync command with the –list-only parameter allows the user to list filenames on a remote machine. But by default, it looks like this. jason@Yog-Sothoth » ~ » $ rsync –list-only [email protected]:/home/jason/Documents/ [email protected]’s password: drwxr-xr-x 4,096 2018/05/09 09:49:49 . -rw-r–r– 867,863 2018/04/19 12:44:56 altis_insurgency_altis.pbo -rw-rw-r– 681,638 2018/05/04 09:03:16 pg768.txt -rwxrwxr-x…

Read More

A useful posting explaining why Linux does not need defragmenting.

If you are interested in how the Linux filesystem works, then this is a posting you really need to read: http://geekblog.oneandoneis2.org/index.php/2006/08/17/why_doesn_t_linux_need_defragmenting. This is a posting explaining how the Linux filesystem stores file and why it does not need to defragment the filesystem as it stores files more efficiently. I have…

Read More

Some useful tips for listing directories with ls on Linux.

To list the contents of a directory with the listing sorted by size, use the parameters in this example. ls –format=long –sort=size -hls –format=long –sort=size -h This is what you will get. total 15G -rw-rw-r– 1 ubuntu ubuntu 15G Dec 2 2014 crackstation.txt -rw-rw-r– 1 ubuntu ubuntu 20M Mar 20…

Read More

Finding files with the Linux command line. Using find & locate.

Finding files with the Linux command line. Using find & locate The find command on Linux is very useful for finding commands on your Linux installation. In the example below, I am using wild-cards to look for all the c source files in a certain folder. neo@deusexmachina:~/Documents$ find -name "*.c"…

Read More

How to see whether a command is a executable or a shell builtin.

The type command for bash will tell you whether a command is a shell built-in or an executable on it`s own. This is very simple to use. This example shows how it works. jason@DESKTOP-G1QN8C6:~$ type -a echo echo is a shell builtin echo is /bin/echojason@DESKTOP-G1QN8C6:~$ type -a echo echo is…

Read More

How to embed the output of a command into a bash script.

Embedding the output of a command into a bash shell script is quite easy. Here is an example. echo "Hello $(whoami), the date is $(date -u). Have a nice day"echo "Hello $(whoami), the date is $(date -u). Have a nice day" This is the output this will give you. ┌─[jason@neo]─[~]…

Read More

Very useful Linux tips and tricks for the Linux desktop user.

How to make the Xterm font larger.Using the .inputrc file to control keybindings in xterm.Enabling color ls output.Viewing files with the command-line. How to make the Xterm font larger. To make the Xterm font larger, hold the left Ctrl key down and right-click on the xterm window to bring up…

Read More

Find the distance of a light-year and other units with the Linux command line.

This command will show how many kilometers there are in a light year. jason$ units -t ‘1 light year/kilometers’ 9.4605284e+12jason$ units -t ‘1 light year/kilometers’ 9.4605284e+12 If I travelled 800m in 9.58 seconds how many miles per hour is this? jason$ units -t ‘800m/9.58s’ ‘miles/hour’ 186.80053jason$ units -t ‘800m/9.58s’ ‘miles/hour’…

Read More

Use the find command in Linux to look for multiple file types at once.

The Linux find command is useful for finding files on your Linux system. It is possible to look for more than one file type. This example will search for all text and png files under the /usr/share directory. jason@neo:/usr/share$ find -regex ‘.*txt\|.*png’jason@neo:/usr/share$ find -regex ‘.*txt\|.*png’ This example will search for…

Read More

Get a listing of all the urls on a website with this simple Linux command.

This command will return a huge listing of all the visitable url`s on the http://www.google.com.au website. Give this a shot on other websites and see how you go. jason@jason-desktop:~$ wget –spider –force-html -r -l2 http://www.google.com.au 2>&1 | grep ‘^–‘ | awk ‘{ print $3 }’jason@jason-desktop:~$ wget –spider –force-html -r -l2…

Read More

Get the command line of a process without the ps command.

To get the command line of a process without the ps command, and the PID of the command is known, use this command. This example is using a process with a PID of 28633. ubuntu ~ $ cat /proc/28633/cmdline ; echo upstart-socket-bridge–daemonubuntu ~ $ cat /proc/28633/cmdline ; echo upstart-socket-bridge–daemon This…

Read More