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 to read a file into a variable in shell?

I want to read a file and save it in variable, but I need to keep the variable and not …

shell unix sh
How do I pause my shell script for a second before continuing?

I have only found how to wait for user input. However, I only want to pause so that my while …

bash shell unix terminal
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.

linux bash macos shell unix
How to represent multiple conditions in a shell if statement?

I want to represent multiple conditions like this: if [ ( $g -eq 1 -a "$c" = "123" ) -o ( $g -eq 2 -a "$c" = "456" ) ] then echo …

bash shell unix
How do I list all cron jobs for all users?

Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron …

unix cron
Shell script "for" loop syntax

I have gotten the following to work: for i in {2..10} do echo "output: $i" done It produces a bunch of …

unix syntax shell
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 …

linux unix
How to check permissions of a specific directory?

I know that using ls -l "directory/directory/filename" tells me the permissions of a file. How do I do …

unix directory
Find and replace in file and overwrite file doesn't work, it empties the file

I would like to run a find and replace on an HTML file through the command line. My command looks …

shell unix sed io-redirection
sudo: npm: command not found

I'm trying to upgrade to the latest version of node. I'm following the instructions at http://davidwalsh.name/upgrade-nodejs But …

node.js unix npm