Linux Command Line Summary

From HBRC WIki

Jump to: navigation, search

This is a quick summary of useful Linux command line commands:

pwd

Prints the current working directory (i.e. where you are.)

ls

Lists the contents of the current working directory.

ls -F

Lists the current directory, and gives a hint as to which files are directories.

ls -la

List current directory in long format. This include the file protections, file ownerships, file sizes, etc.

cd ..

Change the current working directory by moving up the directory tree by one directory.

cd {new_directory}

Change current working directory to a {new_directory} location.

cp {old_file} {new_file}

Make a copy of {old_file} into {new_file}. If {new_file} already exists, its contents are replaced.

mv {old_name} {new_name}

Rename ("move") the file named {old_name} to {new_name}.

mv {old_location} {new_location}

Move file from {old_location} to {new_location}.

rm {file}

Remove (i.e. delete) {file}.

mkdir {new_directory}

Make a new directory named {new_directory}.

rmdir {old_directory}

Remove (delete) {old_directory}.

more {file}

Display the contents of {file} on the current terminal, stopping for each page.

touch {file}

Create an empty file named {file}.

That should be enough to get you started.

Personal tools