All Questions
87
questions
28
votes
7
answers
111k
views
What is the terminal command other than ctrl + c to exit a running Node.js program in a macOS?
In Linux terminal if I run a command like:
$ node httserver.js
The command runs and by doing ctrl + c the program is terminated and new line comes in terminal for us to enter a command.
I felt ctrl ...
25
votes
4
answers
10k
views
How to get tree -a to ignore .git directories?
I love using tree to list directories, and I have a git repository with all my dotfiles. For me to be able to see them I need to do tree -a, but that will also list the contents inside the .git ...
25
votes
4
answers
56k
views
What's the difference between .profile and .bash_profile, and when do you configure which? (Mac) [duplicate]
Possible Duplicate:
Difference between .bashrc and .bash_profile
What's the difference between .profile and .bash_profile, and when do you configure which?
I.e if I configure the .bash_profile, ...
17
votes
3
answers
22k
views
How to force ls terminal command to show results in Bytes while I have set the default to ls -h in bash profile?
I am following the snippet here to improve my terminal command in Mac OSX.
It sets the default value of ls results to human-readable by exporting alias ls='ls -GFh' to bash profile file. This is very ...
16
votes
4
answers
84k
views
How do I recursively remove subdirectories and files, but not the first parent directory?
I'm able to use the following to remove the target directory and recursively all of its subdirectories and contents.
find '/target/directory/' -type d -name '*' -print0 | xargs -0 rm -rf
However, I ...
14
votes
6
answers
4k
views
Syncing bash profile between computers
I have tons of stuff in my .bash_profile. The problem is, I use ~3 computers very frequently, and I'm tired of having to copy paste my prefs everywhere. Two of them run Ubuntu 10.10, and one runs OSX. ...
12
votes
3
answers
33k
views
What is the difference between terminal and bash? [duplicate]
When I open Terminal Window in Mac OS X, I can type bash and hit enter and I will see:
Last login: Fri Feb 20 14:30:56 on ttys000
Korays-MacBook-Pro:~ koraytugay$ bash
bash-3.2$
I can for example ...
10
votes
4
answers
77k
views
What does an arrow ("->") symbol mean on the command line?
I'm working with Terminal (Mac OS X), but I think this is a built-in part of Linux. Sometimes, when I execute a command, Terminal returns a new, indented line with just -> on the line. It seems ...
8
votes
2
answers
2k
views
Passing options to a program: what's the convention for one dash vs two?
Some programs will take options like this:
$ someprogram -orange apple
And other programs will use something like this:
$ otherprogram --orange apple
Is there a "rule" or convention for this in ...
8
votes
6
answers
3k
views
In Bash (Mac/Linux terminal shell), can the up and down arrow keys be made to function as they do in text editors?
In text editors, if I press the up and down arrow keys, it moves the cursor between lines of text.
In Bash, if I’m typing a long command that spans multiple lines and I press the up and down arrow ...
8
votes
3
answers
571
views
How to have a better view when typing out directories in terminal?
I am currently using a Mac and learning to use the terminal, but the question applies to Linux systems as well.
I would like to ask, when typing out paths in the terminal/command line, is there a way ...
8
votes
2
answers
4k
views
ssh sessions in xterms freeze for many minutes whenever they disconnect
If I ssh to a remote machine and then lose internet connectivity, the session freezes.
I can't control-c or otherwise abort and go back to my local xterm or terminal prompt but if I wait several ...
7
votes
3
answers
2k
views
show man pages in terminal without a pager
man defaults to using a pager. For short pages, I want to just echo them to the terminal without paging. I'm on OS X. Things I've tried:
man -t man #produces PostScript output
man ...
7
votes
1
answer
2k
views
OS X terminal - put flags/options at end of command?
Is there a way on OS X to put flags at the end of a command instead of at the beginning? On my Ubuntu box, either of these will work, but OS X treats -la as a directory argument in the second example:
...
7
votes
2
answers
4k
views
How do you use "sips" at the terminal to resize an image, without upscaling?
I have some code that I've been using to resize images in Mac OS X via the command prompt (and/or quicksilver), to a maximum width or height of 500px. The only problem is that if the original image is ...