≡ Menu

BASH Shell

FreeBSD find the chmod numerical value for a file or directory

I need to find out the numerical value of a file on a FreeBSD system. For example, get 644 instead of -rw-r--r-- for the /etc/resolv.conf file. Is there is a way to get this value in my bash shell script?
[click to continue…]

Sysadmin because even developers need heroes!!!

How to enable colorized output for the ls command in Mac OS X Terminal

I am new to Apple OS X. How do I enable colorized output for my ls command on Apple Mac OS X just like the ones that shown on my Ubuntu Linux server? How do I configure Mac OS X Terminal app to have color ls output?
[click to continue…]

How to use curl command with proxy username and password on Linux or Unix

My sysadmin provided me the following proxy details:
       IP: 202.54.1.1
       Port: 3128
       Username: foo
       Password: bar

The settings worked perfectly with Google Chrome and Firefox browser. How do I use it with the curl command? How do I tell the curl command to use my proxy settings from Google Chrome browser?
[click to continue…]

How to undefine and unset a bash environment variable on Linux or Unix

I have set the shell variable. I no longer need the variable. How do I undefine or unset a variable in bash on a Linux or Unix-like desktop system?
[click to continue…]

How to delete a single command from history on a Linux, OS X and Unix Bash shell

I‘m working in Ubuntu bash terminal application and remotely on a RHEL server in cloud platform. I typed the wrong and dangerous command. I no longer wish to remember dangerous command in the history file. How can I remove or delete a single command from bash history file?
[click to continue…]

How to backup and restore a partition table on Linux

Is it possible to just backup my Linux partition table and restore it when required? How do I restore partition table if it get deleted by mistake on Linux operating system? How do I backup and restore a GPT partition table on Linux?
[click to continue…]

How to find out Mac OS X operating system version information from Terminal command prompt

I use ssh client to login into my Mac Min server without GUI. How can I tell what version of Mac OS X operating system am I using command prompt? How do I find out Mac OS X version from Terminal app bash shell?
[click to continue…]

How To Update Apple OS X Using Command Line Software Update Tool

How do I install software updates from the command line tool on my Apple Mac OS X computer? How can I remotely update my Apple computer by just sshing into a system? Is there is something like apt-get command or yum command for Apple OS X?
[click to continue…]

How To Create Disk Image on Mac OS X With dd Command

How do I create or write to images to disk on Apple Mac OS X Unix operating system with dd command?
[click to continue…]

How To Find Out HP Network Printer Serial Number Remotely Using Bash Shell On Linux or Unix

I manage a small network including couple of HP printers. Is there an easy way to access HP printer serial number in the terminal on Linux or Unix-like system? How do I find the model, product, and serial number on my HP printer using bash command line options?
[click to continue…]