89 Answered Questions for the topic UNIX

Unix Linux Bash Path

03/27/19

How to permanently set $PATH on Linux/Unix?

I'm trying to add a directory to my path so it will always be in my Linux path. I've tried: export PATH=$PATH:/path/to/dir This works, however each time I exit the terminal and start a new... more

03/26/19

Linux: copy and create destination dir if it does not exist?

I want a command (or probably an option to cp) that creates the destination directory if it does not exist. Example: cp -? file /path/to/copy/file/to/is/very/deep/there

03/26/19

How do I get cURL to not show the progress bar?

I'm trying to use cURL in a script and get it to ***not*** show the progress bar. I've tried the `-s`, `-silent`, `-S`, and `-quiet` options, but none of them work. Here's a typical command I've... more

03/19/19

How to colorize diff on the command line?

When I have a diff, how can I colorize it so that it looks good? I want it for the command line, so please no GUI solutions.
Unix Bash Shell Tcsh

03/18/19

How to determine the current shell I'm working on?

How can I determine the current shell I am working on? Would the output of the `ps` command alone be sufficient? How can this be done in different flavors of UNIX?

03/18/19

What is the difference between a symbolic link and a hard link?

Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs... more
Unix Linux Grep

03/15/19

How do I grep recursively?

How do I recursively `grep` all directories and subdirectories? find . | xargs grep "texthere" *

03/14/19

How to find out what group a given user has?

In Unix/Linux, how do you find out what group a given user is in via command line?
Unix Process

03/14/19

127 Return code from $?

What is the meaning of return value 127 from $? in UNIX.
Unix Linux

03/14/19

Using ls to list directories and their total sizes?

Is it possible to use `ls` in Unix to list the total size of a sub-directory and all its contents as opposed to the usual 4K that (I assume) is just the directory file itself? I.E. total 12K ... more

03/14/19

grep, but only certain file extensions?

I am working on writing some scripts to `grep` certain directories, but these directories contain all sorts of file types. I want to `grep` just `.h` and `.cpp` for now, but maybe a few others in... more

03/14/19

How to run a shell script on a Unix console or Mac terminal?

I know it, forget it and relearn it again. Time to write it down.
Unix Shell

03/14/19

Listing only directories in UNIX?

I want to list only the directories in specified path (`ls` doesn't have such option). Also, can this be done with a single line command?

11/13/14

What is the difference between the zsh shell and the bash shell?

What is the difference between the zsh shell and the bash shell? What is so interesting about the zsh shell?  

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.