Category: Linux

  • LINUX: Removing Files Older Than x Days

    It can often be useful to remove files that are unnecessary, such as log files, backup files, etc, when it is not already done automatically. Fortunately there is a very simple command to do just that. Using the find command, it is possible to find the files in the folder you want to clean out […]

  • Mounting CIFS Shares At the LINUX Command Line or in /etc/fstab

    Linux makes it relatively easy to mount shared drives either manually, at the command line, or automatically, by configuring an entry in /etc/fstab. Here is the basic syntax of our mount command. [ccase@midas ~]$ sudo mount -t cifs -o username=,password=, /// Here is an example of mounting our CIFS share to a folder named myshare. […]

  • Getting the Last Modification Timestamp of a File with Stat

    If we want to get just the date modified, for a file, in a format of our choosing. This can be done with a utility called stat. The syntax is as follows: stat -f -t “” In this example, we are printing just the date created in the format YYYYMMDD_HHMMSS. stat -f “%Sm” -t “%Y%m%d_%H%M%S” […]

  • Using the Linux Command Line to Find and Copy A Large Number of Files from a Large Archive, Preserving Metadata

    One of my recent challenges is to go through an archive on a NAS and find all of the .xlsx files, then copy them; preserving as much of the file metadata (date created, folder tree, etc) as possible, to a specified folder.  After this copy, they will be gone through with another script, to rename […]

  • Linux Mint 13: Enabling the SD Card Reader on the Toshiba Satellite P870

    I started using SD cards recently and had a heck of a time using it on my laptop at first. I tried using my 32 GB SDHC card in the USB adapter, to no avail, then I found the SD slot and it still did not work either. It turned out that the driver was […]

  • Toshiba P870: Installing Linux Mint

    I have recently started using a Toshiba P870 laptop and decided to install Linux Mint 13 Maya (Cinnamon Edition) on it, due to its ease of use and overall security soundness. Being as the Toshiba P870 is a relatively new laptop, with some components’ drivers not having been included in the installation files of Mint, […]

  • Appending to a Remote File via SSH

    Most LINUX users know how to copy and overwrite a file from one server to another; but it can also be useful to directly append to a file, without having to login to the remote server and make the changes manually. This does not appear to be possible with the commonly used SCP utility; however, […]

  • Tunneling Through a Remote Firewall Using SSH Commands

    If you’re dealing with systems behind a firewall it’s almost inevitable that you will need to tunnel into those systems from time to time.  Fortunately, there are some quick & easy commands to accomplish this.  In this example, we are going to use a Mac OSX or linux-based system, to gain access to a web […]

  • Tar/GZip Files in One Operation, Unattached to the Terminal Session

    When you’re trying to move a large block of files, its often useful to do so in one command and to be able to close your terminal window (or allow it to time out). If you run a command under normal circumstances, losing the connection can cause your command to terminate prematurely, this is where […]

  • SSH: DSA Key Issue: Unknown code krb5 195

    I was attempting to set up an SSH key between two servers, so I could automatically back up a file from one to the other. This is usually a fairly straightforward and routine procedure; but in this case I had some issues. When I got everything set-up, with the public key in the accepted_keys file […]