All Questions
71
questions
0
votes
1
answer
58
views
cp matching files in CLI on OSX with path slightly modified
I am trying to find a command that finds and copies files with a given name to a another folder but with a slightly different path.
For e.g. there are 4 copies of PNG files named ic_arrow.png
app/...
1
vote
1
answer
409
views
Matching multiple path-components with `find`
Let's say I want to find all the node_modules folders in my Code directory:
find ~/Code -name 'node_modules' -type d
But what if I want to find all the setup folders, that themselves are inside test ...
2
votes
1
answer
3k
views
Long form command line flags in Terminal?
I hope this is the right place to ask this question. So basically, I'm currently combing through some of the more commonly used Terminal commands, and I find it really hard to remember the short form ...
1
vote
1
answer
382
views
Output of du command
I have a folder and it is 16.91GB in size(I checked in Finder).
I tried to check the size by using du command.
So, I tried du -sh ~/folder and I got 16G.
I thought I will get the output in Bytes ...
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 ...
9
votes
3
answers
78k
views
How to run a bash script via absolute path?
I have a file:
/Users/danylo.volokh/test/test_bash_script.sh
Content is very simple:
#!/usr/bin/env bash
echo "-- print from script"
I'm in folder "danylo.volokh"
This command runs fine:
Danilos-...
0
votes
1
answer
1k
views
Alias command from terminal that opens a new terminal on a specific folder
I have this command already working in my .bash_profile:
alias mysite='cd /Applications/sites/mysite;pwd; php artisan serve --port=9000 | open http://localhost:9000 | open -a Finder ./'
So it:
CD's ...
1
vote
1
answer
2k
views
Command line for Application alias in Mac OS X
I’m working on an installer for a project and I’ve written a post-install script that runs the executable for my project after it’s done.
I want to know the command line argument—or if there is a way—...
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 ...
2
votes
3
answers
10k
views
How to switch between command-line and GUI in VM on a Mac?
I have installed CentOS 7.1 in VMware Fusion of my Mac. I logged into the terminal (default runlevel 3) and started the GUI using the command "startx". I want to switch back to the terminal.
Ctrl+Alt+...
0
votes
1
answer
88
views
diff style comparison of directory contents against line by line contents of text file
Unlike many of the file and directory comparison utilities out there, including diff, I've only seen literal file to file (sometime, more than two files) and directory to directory comparisons.
I'm ...
1
vote
1
answer
964
views
Terminal new window always shows -bash: Searching: command not found
When open terminal, it always shows -bash: Searching: command not found. It does not affect other functions, just each time, even though open a new terminal window, it still pops up at the top of the ...
2
votes
5
answers
406
views
How can I convert all “x”s to “y”s in filenames for a specific directory from the command line?
I have been naming files, of out habit as a programmer working on a server command line, with underscores “_” rather than spaces “"—because from the command line you have to escape spaces—but that is ...
1
vote
1
answer
360
views
How to get different prompt look for root and regular user
My .bash_profile has different styles of prompt for regular user and root but in order it to work the .bash_profile should be reloaded every time I switch users. How can I achieve this?
Can I make ...
2
votes
2
answers
6k
views
OSX bash command line countdown timer
I found here on superuser the following nice countdown script that I could include in my .bash_profile:
function countdown(){
date1=$((`date +%s` + $1));
while [ "$date1" -ne `date +%s` ];...