What are some basic Linux shell commands?

filename.txt Same as ls �alR, outputs the results to a file
ls *.html Lists all files ending with .html
cd [directory name] Changes to a new directory
cd .. Changes to directory above current one
clear Clears the screen
vdir Gives a more detailed listing than the "ls" command
exit Log off your shell

mv [old filename] [new filename] Move/rename a file
cp [filename] [new filename] Copies a file
rm [filename] Deletes a file
rm * Deletes all files in current directory
rm *.html Deletes all files ending in .html

mkdir [directory name] Creates a new directory
ls -d */ Lists all directories within current directory
cp -r [directory] [new directory] Copies a directory and all files/directories in it

find . -name [filename] -print Searches for a file starting with current directory
grep [text] [filename] Searches for text within a file

File permissions:
0 = --- No permission
1 = --X Execute only
2 = -W- Write only
3 = -WX Write and execute
4 = R-- Read only
5 = R-X Read and execute
6 = RW- Read and write
7 = RWX Read, write and execute

chmod 604 [filename] Minimum permissions for HTML file
chmod 705 [directory name] Minimum permissions for directories
chmod 755 [filename] Minimum permissions for scripts & programs
chmod 606 [filename] Permissions for data files used by scripts
chmod 703 [directory name] Write-only permissions for public FTP uploading" style="width:auto; height:300px;" cols="100" rows="10" >The following is a list of commands that you might find helpful when modifying your files on the server. 

For more complete information on using commands, you can refer to the manual by typing man [command] at the shell prompt, where "[command]" represents the command you would like more information about. You can also type [command] -? and [command] --help.

Note: When something is specified in brackets, such as [command] or [filename], it is used to indicate that you must input your desired information here. Do NOT include brackets in your command.

pwd Shows the full path of the current directory
ls Lists all the files in the current directory
ls -al Lists all files and information
ls �alR Lists all files and information in all subdirectories
ls -alR | more Same as ls �alR, pausing when screen becomes full
ls -alR > filename.txt Same as ls �alR, outputs the results to a file
ls *.html Lists all files ending with .html
cd [directory name] Changes to a new directory
cd .. Changes to directory above current one
clear Clears the screen
vdir Gives a more detailed listing than the "ls" command
exit Log off your shell

mv [old filename] [new filename] Move/rename a file
cp [filename] [new filename] Copies a file
rm [filename] Deletes a file
rm * Deletes all files in current directory
rm *.html Deletes all files ending in .html

mkdir [directory name] Creates a new directory
ls -d */ Lists all directories within current directory
cp -r [directory] [new directory] Copies a directory and all files/directories in it

find . -name [filename] -print Searches for a file starting with current directory
grep [text] [filename] Searches for text within a file

File permissions:
0 = --- No permission
1 = --X Execute only
2 = -W- Write only
3 = -WX Write and execute
4 = R-- Read only
5 = R-X Read and execute
6 = RW- Read and write
7 = RWX Read, write and execute

chmod 604 [filename] Minimum permissions for HTML file
chmod 705 [directory name] Minimum permissions for directories
chmod 755 [filename] Minimum permissions for scripts & programs
chmod 606 [filename] Permissions for data files used by scripts
chmod 703 [directory name] Write-only permissions for public FTP uploading
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I get SSH access enabled?

If SSH access is not enabled, please open a support ticket and we will activate it for you.

How do I change file permissions via SSH?

Using the CHMOD command:The letters u (for user), g (for group), and o (for other) are used with...

What is Telnet/SSH and do you allow it?

For security purposes, we do not enable Telnet at all and we only enable SSH access by request....

What is SCP / SFTP?

SCP and SFTP are both part of OpenSSH, the secure shell server we run. Do note that you cannot...

How can I check my disk space usage in SSH?

From the Unix prompt, type the following:du -s /home/youruserThis will give you a report back of...