The command line is perhaps the most daunting part of Unix/Linux. This is perhaps because it is also one of the most powerful parts. The amount of work that can be accomplished with one command, built of combinations of smaller commands, is truly amazing.
To issue multiple commands on one line, the output of each will be printed in turn, issue:
command1 ; command2
make bzImage ; echo "^G"
make bzImage, which, if you are in the directory /usr/src/linux,
wil recompile the 'kernel', creating a kernel that is compressed the code that governs access to hardware and other software
on a Linux box. This can be a quite lengthy process, depending on your system. This system runs to completion. Then
the command echo "^G" then will send the control-G sequence to the
terminal. The control-G sequence is also called the 'bell', which has the effect of making many terminals beep.
tree command, but this will show all the files and subdirectories (and
their files) below your current directory. Also, tree is not available on
all systems.
ls -1aF | fgrep /
___________________________ ls lists the names of files | | | _____________________ This is the same as 3 individual switches: | | -1 says list the names 1 per line | | -a says include those that start with a dot | | (normally omitted, considered "hidden") | | -F add a character for the type of file, | | a / is added for subdirectories | | | | ________________ This | symbol takes the output from the ls command and makes it | | | input to the following (fgrep) command | | | | | | | | | __________ fgrep examines input text and prints each line that contains | | | | the string given following the fgrep | | | | | | | | ____ This / is the string fgrep is searching for. | | | | | ls -1aF | fgrep /
du commmand is helpful for this.
du -s some_directory_name
-s causes the command to only list the total blocks (1024 bytes per block by default in
the GNU version shipped with most Linux distributions, 512 bytes per block in older versions) and not the
blocks contained by each file and sub-directory.
du -s `ls -1aF | fgrep /`
______________________________ Finds the size contained in each
| of the following
|
| __ This is the previous chain of commands,
| | which finds the subdirectories of the
| | current directory.
| | Enclosing that string of commands between the
| | ` symbols causes the output of that command
| | to become part of this command.
| |
___| ________________________|
/ \ / \
du -s `ls -1aF | fgrep /`