Wednesday, February 18, 2009

Know the basic commands in linux, unix, shell, and the terminal

Perhaps this paper has been stale for linuxer that use the terminal each day to manage the entire process in the system. But for the newbie that I also like this:) and for those who linuxer new to linux this paper may be very meaningful and very useful to know the basic in-perinta linux unix atu. If the DOS file naming only follow the rules / - of 8.3 (8 character file name and 3 extension) for example, ABCDEFGH.TXT.

Uppercase and lowercase letters in the commands and file names are different, eg different NAMAFILE.tar.gz with namafile.tar.gz, note the command ls will be wrong if diketikkan LS.

There is no mandatory extension like. COM and. EXE to the program and. Batchfile for BAT. diekskusi file that can be marked with the asterisk, if the backup file in the DOS will berekstensi. BAK if dilinux will be marked with a '~' if the file that start with (.) is a hidden file in linux and the file will not be displayed if we provide ls command.

DOS program using sign / sebgai parameter / switch if using dilinux sign - as a parameter / switch, using the example in the DOS command dir / s dilinux when using ls-R.

basic commands linux | unix

1. cp -> basic commands used for copying files or directories.

use:
cp [option] ... [-T] SOURCE DEST
cp [option] ... SOURCE ... DIRECTORY
cp [option] ...-t DIRECTORY SOURCE ...
Copy SOURCE to DEST, or multiple SOURCE (s) to DIRECTORY

Mandatory arguments to long options are mandatory for short options too.
-a,-archive same as-the House of Representatives
Backup [= CONTROL] make a backup of each existing destination file
-b-like backup but does not accept an argument
-Copy-contents copy contents of special files when recursive
-d same as-no-dereference-preserve = link
-f,-force if an existing destination file can not be
opened, remove it and try again
-i,-interactive prompt before overwrite
-H follow command-line Symbolic links
-l,-link link files instead of copying
-L,-dereference always follow Symbolic links
-P,-no-dereference never follow Symbolic links
-p same as-preserve = mode, ownership, timestamps
-Preserve [= ATTR_LIST] preserve the Specified attributes (default:
mode, ownership, timestamps), if possible
additional attributes: links, all
same as-c-preserve = context
-No-preserve = ATTR_LIST do not preserve the attributes Specified
-Parents use full source file name under DIRECTORY
-R,-r,-recursive copy directories recursively
-Remove-destination remove each existing destination file before
attempting to open it (contrast with-force)
-Sparse = WHEN control creation of sparse files
-Strip-trailing-slashes remove any trailing slashes from each SOURCE
arguments
-s,-Symbolic-Symbolic links make links instead of copying
S-,-suffix = suffix override the usual backup suffix
-t,-target-directory = DIRECTORY copy all SOURCE arguments into DIRECTORY
-Q,-no-target-directory treat DEST as a normal file
-u,-update copy only when the SOURCE file is newer
than the destination file or when the
destination file is missing
-v,-verbose explain what is being done
-x,-one-file-system stay on this file system
-Z, context = Context-set security context of copy to Context
-Help display this help and exit
-Version output version information and exit

2. rm -> basic commands used to delete a file or directory.

usage: rm [option] ... FILE ...

-d,-directory unlink FILE, even if it is a non-empty directory
(super-user only, this works only if your system
supports `unlink 'for nonempty directories)
-f,-force ignore nonexistent files, never prompt
-i,-interactive prompt before any removal
-No-preserve-root do not treat `/ 'specially (the default)
-Preserve-root fail to operate recursively on `/ '
-r,-R,-recursive remove directories and their contents recursively
-v,-verbose explain what is being done
-Help display this help and exit
-Version output version information and exit

3. mkdir -> basic commands used to create a new directory

usage: mkdir [option] DIRECTORY ...

-Z,-context = Context (SELinux) set security context to Context
Mandatory arguments to long options are mandatory for short options too.
-m,-mode = MODE set permission mode (as in chmod), not rwxrwxrwx - umask
-p,-parents no error if existing, make parent directories as needed
-v,-verbose print a message for each created directory
-Help display this help and exit
-Version output version information and exit

4. ls -> basic commands used to view the contents of the directory.

5. dir -> basic commands used to view the contents of the directory.

6. vdir -> basic commands used to view the contents of the directory.

7. pushd -> basic commands used to enter into a directory.

No comments:

Post a Comment