Linux/Unix

Posts about using Linux and Unix

Copying Files With Secure Copy

The secure copy command (run using scp) is a Linux command that allows the transfer of files between two computers. This can be locally to a remote server, from a remote server to a local location, or even between two remote servers.

When copying to or from a remote host scp uses ssh for the data transfer. This means that authentication is required, but the files are copied in a secure fashion. When starting a scp request the command first sets up an ssh connection to the remote location, which is then used for the rest of the transfer.

philipnorton42 Sat, 06/15/2013 - 18:52

Monitoring Performance With Munin

20th May 2013

I have been searching for a good server monitoring solution for a while so that I can keep an eye on some of the servers that I run. Tools like Smokeping, Cacti and Nagios seemed promising at the outset, but they are more concerned with bandwidth and server status, not how the server is running.

Uzing Tar To Compress And Uncompress Files

3rd February 2013

The tar command can be used to compress or extract one or more files in Linux. A tar file isn't actually a compressed format, instead it is a collection of files within a single file. The tar command can take one or more files, convert them into a tar file and then compress it into a gzip file format. The file created will have the extension tar.gz.

There are a large number of flags that can be used but the main ones for everyday use are.

SSH Bad Owner Or Permissions Error

21st January 2013

After a recent update on Ubuntu I found that I was unable to use ssh due to a strange permissions error to do with the ssh config file. This was quite a problem as I wasn't able to push changes to my git server. The error was as follows:

Grep For Text In All Files In A Directory

16th January 2013

Searching all files in a directory and sub-directories for a particular term is really useful and comes in handy in all sorts of situations. It is available on all Linux systems and the basic syntax is as follows.

grep -r -i pattern directory

The -r flag is used to recursively search underneath the given directory and the -i flag is used to ignore case. The pattern is a normal regular expression, which can be changed to an extended set by using the -E flag.

Happy Birthday Bash Script

29th October 2012

Following on from the PHP script to print happy birthday I wanted do the same in a bash script. I don't really use bash for much more than stringing together commands so I had to figure out how to do loops and if statements using the simple bash syntax. I also wanted to pass the name of the person as an argument, rather than hard code it into the script. This is what I came up with.

Find The Size Of Files And Directories In Linux With The du Command

The du (or 'disk usage') command is a Linux command that can print a list of the files within a directory including their sizes and even summarize this information. It is useful if you want to see how large a group of files is and provides more information about directories than the ls command does.

philipnorton42 Fri, 06/29/2012 - 09:16
Remove SVN Files From Source In Linux

There might be a couple of reasons why you would want to do this. Perhaps the repository has been checked out instead of exported, or maybe the repository doesn't exist any more. A couple of strategies exist remove all SVN files from a set of directories in Linux. You can either use the rm command directly and pass in a find command using grave accent quotes (key to left of '1').

philipnorton42 Tue, 06/26/2012 - 09:53

Using xclip To Copy Output From The Command Line In Linux

21st June 2012

When copying the standard ouput from within a terminal I often push it to a file using the "command > file" syntax. The trouble is that I then end up with a file that I have to open in order to get the output, and I often forget to delete the file once finished. This is especially annoying when I just want to paste some debug output into a help topic or similar. The solution to this is to use xclip to store the output in the xclipboard instead of a file. This is essentially the function of xclip, it allows access to a clipboard that you can store anything in.

Installing A Realtek Wireless Card On OpenSuSE Linux 11

21st July 2011

I've been using my Medion Akoya E1222 netbook for about a year now and I still think it's an awesome little machine. Recently, I decided to swap from Ubuntu to another Linux distro and have been experimenting with Fedora, JoliOS, PuppyLinux before finally going for OpenSuSE. The only problem I had was figuring out how to get the wireless card working.