Linux commands

Whether I’m working in the terminal on a mac or on a Linux web server, here are my most used Linux commands:

ls -la

ls is used to list files and directories. The options I use most often with this command are -la.

-l
is used to show further information about the files / directories. It is the long listing format and shows file permissions, owner information, file size and time of last modification.

-a
hidden files and folders are not included by default. -a makes sure they are also shown.

 

pwd

Stands for “print working directory”. This command outputs your current location in the file system.

 

cd

Useful key combinations:

shift + a
shift + e

Sassy Colors

Sass makes managing colors in your web site much easier. Sass variables provide a simple way to assign a label to a hex value, so you never have to remember the hex value again.

For example:

$red: #962d3e;

body {
   color: $red;
}

 

Alternatively, Sass maps also work really well.

For example:

$colors: (
   red: #962d3e,
   blue: #343642
)

body {
   color: map-get($colors, red);
}

footer {
   color: map-get($colors, blue);
}

 

rsync

rsync is a great free utility for transferring and synchronising files between computers. rsync is available for Linux, MacOS and Windows (through the Cygwin command line interface).

Here are some of my most frequently used rsync commands.

  1. Copy / synchronise files from a local computer to a remote computer using ssh:

rsync -avhe ssh /path/to/directory abc@123.456.789.10:/path/to/remote-directory