|
Systems commands
Directory Manipulation
When you login into the system, you automatically get into
your home directory
1. Determine the directory you are in:
2. Go to some other directory, for example, /etc:
3. Go to your home directory:
4. Go back-and-forth between directories and check where you are:
5. Create a new directory above your home directory:
6. Go to the new directory and check where you are:
7. Go one step back to the parent directory and check where you are:
8. Remove the new directory:
9. Create a new directory above your home directory with subdirectories.
Try the following:
Does it work? Try the following:
10. Create a few files in Newdir/one:
11. Go back into the original directory and try to delete Newdir:
Does it work ?
Try the following:
12. Repeat step #10; Copy the directory with its tree into another
directory:
same as
13. Show content of file /etc/hosts
14. Show the first and last 10 lines of a file
15. Show date on the system clock
16. File system usage
17. Disk usage
18. Display data
19. Determine file type
20. Who is logined to the system
21. The owner of the current shell
22. Getting information about a file or command, for example netstat
23. Compressing/uncompressing files with gzip, and bzip2:
24. Searching for files by using command find
25. Searching for system files
26. Using tar-gzip to archive a directory.
Create a new directory with subdirectories above your home directory,
then tar and gzip it. For example,
27. To tar and gzip file with one command, try the following:
28. Archive/restore from input file list by cpio command:
29. Command history in bash shell:
Find a command in the history by the regular expression in its name:
then type the string contained in the command.
30. Command history file .bash_history is updated when a user exits the shell.
The size or file .bash_history is defined by env variable HISTSIZE
Reference: Basic System Commands
|
|