E-learning module "Linux Basics"

Useful Commands III

Other useful commands including examples are:

 

$ alias → Is used to create additional names for frequently used commands (including parameters).

Example:
$ lll 
  command not found.

$ alias lll=“ls -lha“ → Create an alias.

$ lll → What happens?

$ alias
  alias lll='ls -lha' → Without a parameter this will display all existing aliases.

 
 

$ apropos → Search the key word in the short description database (whatis).

$ apropos password
  chage (1)     - change user password expiry information
  chgpasswd (8) - update group passwords in batch mode
  ...

 
 

$ date → Display date and time.

$ date -I
  2015-11-14  → Output date in iso-8601 format.

$ date -R
  Thu, 21 Jun 2018 11:15:58 +0200 → Output date and time in RFC 2822 format.

 
 

$ export → Initiates that a variable is forwarded to child processes of a process.

Example:
$ var1=foo
$ export var1
$ export var2=$var1

 
 

$ ssh → Connect to a remote computer and work on it.

$ ssh username@remote-server → Connect to remote-server as user username.

 
 

$ scpsecure copy. Command to copy files or directories to or from a remote computer.

$ scp file user@remote-server:/home/user/ → Copies file to  remote-server into the home directory of user.
$ scp -r directory user@remote-server:/home/user/ → Copies direcory to remote-server.

 

$ tartape archiver. Originally developed to write data to tape. Today it is used to archive data in one file. Note: In contrast to zip, tar preserves the permissions. This is the reason why tar is prefered in a Linux environment.

$ tar -cvf tarfile.tar directory/ → archive direcory into the file tarfile.tar.

 
 

$ which → Show a command with the full path.

$ which vim : /usr/bin/vim

 

Linux knows many compression tools:
  • zip     → Very popular with Windows.    
  • bzip2 → Until recently this was the standard format for Linux systems.
  • xz       → Is about to become the new standard format. Some commands exist to execute xz using the most popular paramters:
    • unxz   → runs xz --decompress
    • xzcat → runs xz --decompress –stdout

 

The content of this e-learning module is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license (CC BY-NC-SA 3.0 DE).



Bisher wurde noch kein Kommentar abgegeben.