Get free disk space and partitions

Show free disk space for all existing partitions (disk free): $> df -haT Example output: Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/ubuntu–vg-root ext4 227G 177G 39G 83% / proc proc 0 0 0 – /proc sysfs sysfs 0 0 0 – /sys none tmpfs 4,0K 0 4,0K 0% /sys/fs/cgroup none fusectl 0 0 0 […]

Samba fileserver

All tricks round about samba fileserver goes here. Print Status: $> smbstatus -L Add User Steps to add a new samba user: add Linux-User(m creates a homedirs under /home/): $> useradd abrandt -d /home/abrandt -c “Annika Brandt” -G users -g users -m set Password: $> passwd abrandt set Samba-Password $> smbpasswd -a abrandt Samba reload […]

Send a mail over a linux shell

Installation: $> sudo apt-get install sendmail $> sudo apt-get install mailutils $> sudo apt-get install postfix Send messages using the mail-command To check If  postfix is installed and ready to work on your system, you can try: $> mail info@ask-sheldon.com Subject: TEST TESTETST EOT (Shortcut: ctrl + shift + d) Reconfiguration of postfix on Debian […]

Get information about the installed linux distribution, kernel and version

Get the kernel version $> uname -a Example output: Linux bravehartk2-ThinkPad-W520 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Or: $> uname -r Example output: 3.13.0-32-generic You can even use the following command to get the kernel version. It will also serve you information about the build date and a […]

Upload File via FTP on shell

To upload a file on the shell via FTP (https://en.wikipedia.org/wiki/File_Transfer_Protocol) you can use the wput command. Therefor you have to install it with your systems package manager (aptitude in this example): $> sudo apt-get install wput Now you can upload files like that: $> wput loacalfiletoupload ftp://user:password@host/path/to/target/on/remote/host Attention: The target path have to be relative to […]

Find out where my.cnf is located

To find out where the MySQL configuration (my.cnf) is stored, you can use the strace command: $> strace mysql “;” 2>&1 | grep my.cnf You will get an output showing all the paths the MySQL deamon searches for the my.cnf upon startup like that: stat(“/etc/my.cnf”, 0x7fffecb75210) = -1 ENOENT (No such file or directory) stat(“/etc/mysql/my.cnf”, {st_mode=S_IFREG|0644, st_size=3505, […]

Download or upload a file over SSH

#Copy something from this system to some other system: $> scp /path/to/local/file username@hostname:/path/to/remote/file   #Copy something from some system to some other system: $> scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file   #Copy something from another system to this system: $> scp username@hostname:/path/to/remote/file /path/to/local/file You can add a port with the -P param You can do it recursive with […]