≡ Menu

BASH Shell

FreeBSD Force DHCP Client (dhclient) to Renew IP Address To Get A New Lease

I have a Linux DD-WRT router DHCP server running on my network. How can I force my FreeBSD based dhcp client to get a new lease from this Linux based router? What is the command in FreeBSD equivalent to Windows’ “ipconfig /renew” command?
[click to continue…]

How to Run and Execute Command When I Log Out Of Linux Session?

I‘m using CentOS 7 server. I need to run a command when I logout using ssh or bash shell. So in Linux and Unix-like systems, how can I run a command to execute when I log out my session?
[click to continue…]

Unix / Linux: Initialize Dot Files Without Restarting The Current Shell Session

I‘m a new Linux, OS X or Unix-like system users. I’m using bash shell. I made changes to my $HOME/.profile ($HOME/.bash_profile) file. How can I restart my session without doing logout and login again?
[click to continue…]

Set Up SSH Tunneling on a Linux / Unix / BSD Server To Bypass NAT

I‘m a new Linux / Unix system user. How can I set encrypted tunnel between my desktop/laptop computer and server in a remote data center to bypass the limits in a network? How do I create a reverse SSH tunnel on Unix-like systems?
[click to continue…]

Linux Redirect Error Output To File

I am a new Ubuntu Linux and bash shell user. I also know how to redirect output from display/screen to a file using the following syntax:

cmd > file
ls > file

However, some time errors are displayed on screen. How do I store and redirect output from the computer screen to a file on a Linux or Unix-like systems?
[click to continue…]

Linux: Bash Delete All Files In Directory Except Few

I‘m a new Linux system user. I need to cleanup in a download directory i.e. delete all files from ~/Downloads/ folders except the following types:

*.iso – All iso images files.
*.zip – All zip files.

How do I delete all file except some in bash shell on a Linux, OS X or Unix-like systems?
[click to continue…]

HowTo: Compile And Run a C/C++ Code In Linux

I am a new Linux user and student who used to write C or C++ programs on MS-Windows. Now, I am using Ubuntu Linux. How can I compile a C or C++ program on Linux operating systems using bash Terminal application?
[click to continue…]

Linux And Unix Command To View File

I am a new Linux bash shell command line user. How can I view a text file using command line on a Linux or Unix-like operating systems? How can I view (open) binary files such as PDF or images on a Linux or Unix like system from command line?
[click to continue…]

HowTo: Upgrade To a Newer Version of Ubuntu 14.04 LTS

Ubuntu Linux version 14.04 LTS has been released. How do I upgrade to a newer version of Ubuntu 14.04 LTS from Ubuntu 13.10 or 12.04 LTS?
[click to continue…]

Linux / Unix: Find And List All Hidden Files Recursively

I am a new Unix system shell user. I need to find and list all hidden files including directories on a Linux or Unix-like system. How can I recursively list all hidden files and directories? How do I save result in a text file?
[click to continue…]