Top "Unix" questions

This tag is EXCLUSIVELY for PROGRAMMING questions that are directly related to Unix; general software issues should be directed to the Unix & Linux Stack Exchange site or to Super User.

How can I check if a directory exists in a Bash shell script?

What command can be used to check if a directory exists or not, within a Bash shell script?

bash shell unix posix
Looping through the content of a file in Bash

How do I iterate through each line of a text file with Bash? With this script: echo "Start!" for p …

linux bash loops unix io
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: …

linux bash unix path zsh
How do I grep recursively?

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

linux unix grep
How to download a file from server using SSH?

I need to download a file from server to my desktop. (UBUNTU 10.04) I don't have a web access to the …

linux unix ssh
How to kill a process running on particular port in Linux?

I tried to close the tomcat using ./shutdown.sh from tomcat /bin directory. But found that the server was not …

linux unix port kill-process
How can I pretty-print JSON in a shell script?

Is there a (Unix) shell script to format JSON in human-readable form? Basically, I want it to transform the following: { "…

json unix command-line format pretty-print
In the shell, what does " 2>&1 " mean?

In a Unix shell, if I want to combine stderr and stdout into the stdout stream for further manipulation, I …

bash shell unix redirect
How to get full path of a file?

Is there an easy way I can print the full path of file.txt ? file.txt = /nfs/an/disks/jj/…

linux file unix path
How to do a logical OR operation in shell scripting

I am trying to do a simple condition check, but it doesn't seem to work. If $# is equal to 0 or …

bash unix if-statement sh