Next Previous Contents

7. Some basic commands

ls

List the contents of the current directory

ls name

List the contents of the named directory (eg. ls /etc)

ls -l

List the directory contents in "long" format, including file permissions, ownership details and file size

ls -a

List all the files in a directory, including files that start with a '.'

cat filename

Display the contents of a file to the screen

more filename

Display a file on the screen, with scrolling and search facilities. less is an enhanced version of more

cp source destination

Copy the source file to the destination (eg. cp /etc/passwd . copies the password file to the current directory)

mv source destination

Move the source file to the destination, which can be a directory or another file

rm filename

Remove (or delete) a file - use with caution!

mkdir name

Make a directory

rmdir name

Remove an empty directory

locate keyword

Displays a list of files that contain the keyword in their filename.

su

Temporarily become the superuser - useful for system administration tasks

passwd

Change the password used to access your user account

who

Display a list of users currently logged onto this computer


Next Previous Contents