Ls - A - Ls .Newsrc
Ls - A - Ls .Newsrc
ls -a Lists all of your files, including the "dot" files. There are a number of files that
start with a . that won't normally show up with when you type ls. An example of such
a file is your .newsrc file.
ls -s Gives you a listing of your files along with their size in kilobytes.
ls -l Gives you a "long listing," which means that your files will be shown in one
vertical column and the file size and file access modes for all files will be shown.
All of these switches can be combined, so one might type ls -as to list all of one's
files and find their size.
cp Copies a file to a specified location. Can be used to copy a directory with files in it
using cp –r .
Examples:
cp ~/myfile ~/mydir/
cp file1.txt newfile.txt
cp –r ~/myproject/ ~/myprojectbackup/
mv Moves (or renames) a file to a specified location. Similar to cp except that it deletes
the source file (or directory, no option needed).
Examples:
mv ~/myoldfilename ~/mynewfilename
mv file* ~/mydirectoryoffiles/
mv ~/mydir/ ~/myotherdir/
rm Deletes file(s) or directory trees. There is no undoing! Can be used to delete all files
and subdirectories with rm –rf .
Usage: rm [-rf] [file or directory]
Examples:
rm mytxtfile.txt
rm –rf ~/mydir/ (removes the directory and everything in it)
rm –rf ~/ (don't do this!)
pwd Prints the working directory. This could be called your current path or view.
cd Changes your working directory or view or where you're “in” to another specified
location.
Examples:
cd ~/ (home directory)
cd somedir/someotherdir/
cd / (root directory)
cd .. (parent directory)
mkdir Creates a new directory. You can specify a location if you like.
Examples:
mkdir newdir
mkdir ~/newdir
mkdir olddir/newdir
rmdir Removes (deletes) a directory. You can only use this on empty directories.
Examples:
rmdir ~/olddir
rmdir olddir/empty/
chmod Modifies the permissions of files or directories. Permissions are rules about how and
which users can access the files or directories. The three switches covered here
are: r -read access, w -write access, x –execute access.
Examples:
chmod +r myfile (adds read access to a myfile)
chmod –w myfile (removes write access to myfile)
chmod +x myfile (adds execute access to myfile)
man The man Linux tool is shorthand for "manual." Most Linux programs and utilities have
brief documentation installed on the system. In order to access these online manuals,