Omid's Blog

The Command Line Crash Course

A quick review of command line

grep Hello *.txt

Looks for the word Hello in all the txt files in the current directory.

cat > omid.txt

Creates omid.txt and enteres whatever I type after that into it.

 

$ find . -name "*.txt" -print
<pre><span class="gp">$</span> apropos search</pre>
print working directory
hostname
my computer’s network name
mkdir
make directory
cd
change directory
ls
list directory
rmdir
remove directory
pushd
push directory
popd
pop directory
cp
copy a file or directory
mv
move a file or directory
less
page through a file
cat
print the whole file
xargs
execute arguments
find
find files
grep
find things inside files
man
read a manual page
apropos
find what man page is appropriate
env
look at your environment
echo
print some arguments
export
export/set a new environment variable
exit
exit the shell
sudo
DANGER! become super user root DANGER!
chmod
change permission modifiers
chown
change ownership
$ mkdir -p temp/stuff/things/frank/joe/alex/john
No error if existing, make parent directories as needed

- ls -lR
  lists all the subdirectories 

The pushd command takes your current directory and "pushes" it into a list for later, then it changes to another directory. It's like saying, "Save where I am, then go here."
Posted October 25, 2014

Omid Hezaveh lives and works in Helsinki find him on twitter