You can use cd to change into nested directories. For example, starting in the home directory,
~>type
~> cd steve/projects/brachy/feb/junkand you'll see a prompt that looks like this:
~/steve/projects/brachy/feb/junk>
~/steve/projects/brachy/feb/junk> cd ..
~/steve/projects/brachy/feb>
~/steve/projects/brachy/feb> cd ../..
~/steve/projects>
~/steve/projects/brachy/feb> cd ../apr
~/steve/projects/brachy/apr>
~/steve/projects/brachy> cd ~
~>
A dash is a shortcut for the last directory you were in:
~/steve/projects/brachy> cd ~/bin
~/bin> cd -
~/steve/projects/brachy>
mkdir new_directoryname
rmdir old_directoryname
Note that with this command, you can't remove a directory if it has any files or subdirectories in it.
ls filename[s]
Typing ls alone will list the files in the current directory. There are a variety of arguments to ls that give you more information about files.
ls -t sorts files by modification time (or date).
ls -l lists copious information about each file,
including size in kilobytes and date of last modification.
ls -F appends a / to each directory and a * to each
executable file.
Combining arguments can be useful:
ls -lt sorts by and displays modification time
ls -F | grep "/" lists only directories.
* (asterisk) stands for zero or more of any character;
alone, it means "all files in the directory"
m* matches all files beginning with m
m*.txt matches all files beginning with m and ending with
.txt
? (question mark) stands for any single character in a file
name