Directory and file commands

  • cd - Changes the directory you are in, e.g. to go to the mnt directory:
  • cd /mnt
  • cd .. - Moves you up one directory, e.g. from /home/user to /home:
  • cd ..
  • ~ - Move to the users home directory:
  • ~
  • ls - Lists the directory contents (minimal):
  • ls
  • ls -laF - Lists the directory contents (detailed):
  • ls -laF
  • du - Disk space usage, e.g. list directories and sizes:
  • du -sm *
  • cat - Prints (via the terminal) the contents of a file:
  • cat some-file
  • mkdir - Creates a directory:
  • mkdir some-directory
  • mv - Moves or renames a file or directory:
  • mv /dir/some-file /dir2/some-file
  • cp - Copies a file:
  • cp some-file some-file-backup
  • rm - Removes (deletes) a file:
  • rm some-file
  • rm -r - Removes (deletes) a directory and its contents:
  • rm -r some-directory
  • rmdir - Removes (deletes) an empty directory:
  • rmdir some-directory
  • touch - Creates a file (if file already exist, the timestamp is updated):
  • touch some-file

Go back to the How-to Guides main page.

Search

Starter website

Offering small businesses and individual users the opportunity to have their own website on the internet, our 'starter websites' are available for only £150.

new site offer

To find out more and to see an example of the type of site offered, view our example starter website page.