IT group
HU Berlin | Department of Mathematics | IT Group | Allgemeines | Linux
Deutsch | English

Linux

These days, you can usually use Linux just as easily as Windows. The differences are mostly felt when working on the command line. If you need to use it, we have compiled a list of important commands for basic tasks.

Commands

cd

Changes the current directory. Either cd directory to change into the directory named directory or just cd to change into the home directory.

pwd

Print working directory. Shows where you currently are.

cp und mv

Copies and moves files, respectively. Warning: The target may be overwritten without confirmation!.

Examples:

cp Source TargetCopies fileSource into file target
mv Source Target_directory/Moves fileSource into the directory Target_directory
cp -r Source_dir/* Target_dir/Copies the contents of the directory Source_dir into the directory Target_dir

rm

Removes files and directories. Warning: The files deleted that way cannot be easily restored and there is no confirmation. Check your input carefully

Example: rm File — Deletes file File.

grep

Globally search a regular expression and print. Searches files or input with regular expressions. Example: grep -i Word File* — Searches all files beginning with Datei for the String Word case-insensitively.

mc

Friends of classical file managers (like Norton Commander) will find an adequate replacement in Midnight commander:
  Left     File     Command     Options     Right                                                   
┌<─ / ──────────────────────────────────────.[^]>┑┌<─ ~ ──────────────────────────────────────.[^]>┑
│'n          Name            Size  Modify time ││'n          Name            Size  Modify time │
│/.config                   │   4096│Mar  1 18:08││/.defcon                   │    512│Oct  4  2012│
│/bin                       │   4096│Jul 31 11:21││/.Desktop.old              │    512│Oct 27  2005│
│/boot                      │   4096│Jun 25 11:20││/.eclipse-platform         │    512│Dec  1  2005│
│/data                      │   4096│Mar 19 12:30││/.emacs.d                  │    512│Feb  4  2009│
│/dev                       │   5020│Aug  7 09:55││/.felix                    │    512│May  1 09:38│
│/etc                       │  12288│Aug  6 15:05││/.fontconfig               │   7680│Aug  7 11:08│
│/home                      │      0│Aug  7 09:55││/.fonts                    │    512│Oct 25  2005│
│/home_m                    │   4096│Mar 18 10:06││/.freerdp                  │    512│Jul  9 09:22│
│/home_s                    │      0│Aug  7 09:55││/.fullcircle               │    512│Jan 18  2007│
│/lib                       │   4096│Jun 19 11:07││/.fvwm                     │   1536│Dec 18  2008│
│/lib64                     │  12288│Jul 31 11:21││/.gconf                    │    512│Aug  7 11:11│
│/lost+found                │  16384│Feb 20 10:54││/.gconfd                   │    512│Oct 11  2012│
│/media                     │     40│Aug  7 09:55││/.gegl-0.0                 │    512│Apr 30  2010│
│/mnt                       │   4096│Jul 15  2012││/.ghc                      │    512│Nov  8  2012│
│/opt                       │   4096│Feb 20 13:45││/.gimp-2.8                 │   1024│Jul 25 15:55│
│/proc                      │      0│Aug  7 09:54││/.gnome                    │    512│Nov 24  2005│
│/rhome                     │      0│Aug  7 09:55││/.gnome2                   │    512│Jul  5 14:20│
│/root                      │   4096│Aug  6 12:45││/.gnome2_private           │    512│Oct 20  2005│
│/run                       │    980│Aug  7 11:23││/.gnupg                    │    512│Jan 25  2013│
│/sbin                      │  12288│Jul 19 11:21││/.gps                      │    512│Aug  2  2012│
│/selinux                   │   4096│Jul 15  2012││/.gstreamer-0.10           │    512│Aug  6 12:46│
│/srv                       │   4096│Feb 20 11:03││/.gvfs                     │    512│Nov 10  2009│
│/sys                       │      0│Aug  7 09:54││/.Heaven                   │    512│Jun 21  2012│
│/tmp                       │  16384│Aug  7 11:24││/.hplip                    │    512│Nov 10  2009│
├────────────────────────────────────────────────┤├────────────────────────────────────────────────┤
│/.config                                        ││/.gnome2_private                                │
└──────────────────────────────── 17G/31G (52%) ─┘└─────────────────────────────── 72G/246G (29%) ─┘
Hint: Setting the CDPATH variable can save you keystrokes in cd commands.                           
wr2(gottscha):/>                                                                                 [^]
 1Help     2Menu     3View     4Edit     5Copy     6RenMov   7Mkdir    8Delete   9PullDn  10Quit