All Questions
33
questions
5
votes
1
answer
68
views
How to reposition window in SSH session? I am logging into a Linux machine from a Mac machine
I am using a Mac with XQuartz to display an X application running on a remote CentOS machine.
I'm trying to reposition the window from the remote machine using my keyboard, as it opens in such a way ...
0
votes
1
answer
426
views
How do I use sed to parse a string that includes hyphens?
Input example:
foobar_1-1 1024 x 1024
Desired output
foobar_1-1
The hyphen is causing issues here. It's causing the output to be two items in the array:
foobar_1, 1
Any advice?
1
vote
0
answers
746
views
macOS: How to switch default rsync with a MacPorts version
The default version of rsync (2.6.9) provided with macOS Sierra, High Sierra and Mojave does not work well with newer installations of rsync (3.1.x). For example using rsync -x on a remote machine ...
3
votes
0
answers
2k
views
Why does this netcat pipeline work in macOS but not Linux?
I set up the following pipeline. This allows me to see the raw HTTP requests and responses that pass through the pipeline.
Note: I use BSD nc below (this is what comes with macOS and AmazonLinux), ...
13
votes
2
answers
4k
views
Use of / when using cd
I'm in my home directory on my mac:
$ pwd
/Users/lukas
When I cd around, I do not (and can't) start the path with /:
$ cd Documents/
/Users/lukas/Documents
$ cd /Documents
-bash: cd: /Documents: ...
1
vote
0
answers
1k
views
See output command terminal history in zsh terminal
I'm in an edge situation and I really need to retrieve some generate random value I executed last week in iTerm through the command: cat /dev/urandom |LC_ALL=C tr -dc 'A-Z9' | fold -w 81 | head -n 1
...
4
votes
1
answer
3k
views
How to add blank lines above the bottom in terminal
In vim and many other text editors, you can scroll up the end of the file to the top of your screen while showing the rest of the lines as blank. But in terminal, by default, the end of line is fixed ...
0
votes
1
answer
684
views
How to use the lastb command from Mac terminal?
In bash on mac, when trying to list recent bad logins, the lastb command is unrecognized, while it works fine on my Linux machine. Does it need to be installed or is it a different command for macs?
9
votes
2
answers
34k
views
How to launch Chrome with explicit "hardware acceleration" setting?
There is an advanced setting in Google Chrome to toggle "hardware acceleration."
On a Mac, I want to be able to choose whether Chrome launches with this option on or off.
Any way to do this? (from ...
17
votes
7
answers
17k
views
Any way to avoid dot-slash when running executable scripts in bash?
let's say I have a script.
chmod +x myscript
Now to run this I go
./myscript
But is there any way I could just run it by typing
myscript
???
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
436
views
Cat and/or echo several things into one file on "one command line"
I know we can do things like this:
stat -f%z mybigfile > RELEASENOTES.txt
and
echo "bytes" >> RELEASENOTES.txt
Now RELEASENOTES.txt will look like this:
47556304
bytes
How can I get "...
0
votes
2
answers
344
views
Mac OS .bash_profile errors
I'm running Mavericks 10.9.5 and I have tried to install Metasploit from this guide.
It was until the Install Homebew I used
echo PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile
...
1
vote
0
answers
78
views
In the Terminal is there a way to search for a command you previously entered? [duplicate]
In the Terminal is there a way to search for a command you previously entered? Say you typed something in just a moment ago, you can press the up arrow. But if you typed it in hours ago, or a day ...
1
vote
2
answers
2k
views
Choose which binary is default binary on Mac OS X Mavericks
I have installed the latest SVN 1.8 via homebrew on my Mac. However now If I run svn --version I get back that I have 1.7. Next thinng I run which -a svn which then shows me I have it twice:
/usr/bin/...
1
vote
1
answer
2k
views
Unable to write to NFS share, Finder hanging
I've a issue with an nfs share : this is my setup :
/etc/exports :
/home/delaland/sharetest 111.111.111.111(rw,all_squash,anonuid=1000,anongid=100,sync,insecure,no_subtree_check)
all needed ports ...
4
votes
0
answers
305
views
Matching bracket selection on gnome-terminal, like Mac OSX terminal
I have recently fallen for a (non obvious) feature of the Mac OSX terminal:
Given a display of some kind of deeply nested text with lots of matching brackets, parenthesis, or quotes (ie. JSON), the ...
2
votes
3
answers
7k
views
Bash Resize Terminal Xterm
I am looking for a universal builtin command that resizes Xterm based terminals.
This is some sort of command that won't make a new window, that I won't need to include in the file that these ...
5
votes
1
answer
213
views
Can one install linux on a Mac via ssh?
Title says it all, read on if you think this an odd request.
I realize that this question is quite unusual, but ssh and FTP are the only access methods for my Mac.
Why I'm doing this:
The situation: I ...
38
votes
4
answers
66k
views
combining commands on the terminal on Mac OS X
I would like to write the following on one line in the terminal or if there is a shorter way to create a file and set the permissions then please do comment.
sudo touch .htaccess
sudo chmod 766 ....
5
votes
2
answers
6k
views
is there a linux equivalent of iTerm(mac) sending command to multiple tabs functionality?
in iTerm, you can send a command to execute simultaneously on a set of already opened tabs. Is there a way to do this in linux (with gnome-terminal preferably)?
for instance, supposed that I had 10 ...
1
vote
1
answer
2k
views
Using grep to move files, Mac
I want to do a search using grep inside all the files of a directory for the pattern '@mail.ru>' (to clean up a mess from a spammer). Using Mac OS X's command line, which should be similar to most ...
2
votes
1
answer
205
views
What is the opposite of this terminal keyboard action?
Open terminal > preferences > keyboard
I have control cursor right as \005. I like it! When inside Vim, it moves the page down 1 line while keeping my cursor unmoved.
Try it.
My question is: how ...
1
vote
3
answers
412
views
How \ why does echo $'\ec' work? What is it doing to clear the terminal?
On the terminal prompt for OS X I can type in echo $'\ec' and ti will clear the console. I have no idea why this works, though. What is it doing?
I'm guessing this would work on other versions of ...
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, ...
2
votes
2
answers
7k
views
mac terminal - remove text prefixing dollar sign
Does anyone know how to remove the text prefixing the dollar sign in mac terminal?
For example,
Peters-MacBook-Pro:~ peter$ ls my_dir
should become
$ ls my_dir
3
votes
2
answers
2k
views
Terminal emulator for GNOME with display features like Mac OS X Terminal?
Is there a terminal emulator which works well in an Ubuntu desktop and provides the following features which Mac OS X's Terminal application has?
Rewrapping text when the window is resized.
A “Clear” ...
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 ...
1
vote
3
answers
3k
views
Where do you find the Bash source files of programs in Linux/Mac OSX?
I am currently writing some convenience methods for my terminal in my bash_profile and am sure if what I am writing is "the best way". I figure a good way to verify whether what I'm doing is right or ...
41
votes
4
answers
128k
views
Searching Mac Through Terminal?
are there any commands to search your Mac using terminal? I tried usin grep to search but it seems somewhat unresponsive and nothing comes up.
For example, I would type "grep Files" (A folder name) ...
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 ...
29
votes
4
answers
140k
views
Make the background black, not white on Linux/Mac OS X Terminal?
All I want to do is make the background for Mac OS X's Terminal Black so that I can run a Perl script with Terminal and have the background black for that.
How would I do this for Mac OS X?
How would ...
64
votes
6
answers
15k
views
Equivalent/Alternatives for Alt+Dot in Mac
One thing i miss from the Linux shell is the Alt+Dot shortcut. What it does is insert the last argument of the previous command. It appears to be a trivial technique, but it's really useful.
i.e. if ...