Hot answers tagged

18

The open utility on Mac does not read from standard input, but take its arguments from the command line. To open the current working directory, you would have to say $ open "$( pwd )" or $ open "$PWD" or simply $ open . as pointed out in the comments below. With the -f flag, open can be made to read from standard input, but only to open whatever ...


12

I don't have a Mac so I can't test it, but the solution should be something like: open "`pwd`" Not all programs take their input from stdin which would be necessary for the pipe to work.


11

On OSX, uname -s returns Darwin (most Linux uname programs return Linux). As a general rule (aside from personal use), uname has quirks for different systems. In autoconf, scripts use config.guess, which provides consistent information. For example in my Debian 7, x86_64-pc-linux-gnu and in OSX El Capitan x86_64-apple-darwin15.5.0 You could use if-...


7

if [[ $(uname -s) == Linux ]] then doThis else doThat fi


7

Well, if you know your IP starts with 10.16, it's trivial: ifconfig -a | grep -oP '\b10\.16\.[0-9.]+\b' Or, if your grep doesn't support -P or -o: ifconfig -a | awk '/10\.16\./ && /inet/{print $2}' If not, you could find all lines starting with inet and print their second field: ifconfig -a | awk '$1=="inet"{print $2}' That, however, would ...


7

The other answers are totally correct. If you want an easy shorthand, you can do as @fd0 proposed, and just use open . to open the current directory. The current directory is named . (a single dot) in Unix, the parent directory .. (two dots).


5

pwd | xargs open xargs shoves its standart input into the arguments of its first argument.


4

Have a look in your shell initialization scripts for bash, or the screen config file, and see if there's anywhere false is being used with the explicit path /bin/false. On OS X, the false utility is located in /usr/bin, not in /bin. Failing that, see if your login shell for some odd reason is set to /bin/false, either by inspecting /etc/passwd or looking ...


4

Normally less "clears the screen" (which probably refers to switching back to the normal screen from the alternate screen) when the terminal description has the appropriate escape sequence in the rmcup capability. You would see a difference if you are using different values of TERM in the two programs. The infocmp program can show differences for the ...


3

Under -E, you need to use unquoted parentheses to create a capture group. sed -E 's:(foo):(\1):'


3

on OSX the man pages are stored on /usr/share/man/man5/. Some of them are already installed (e.g. for fstab). But for e.g. tar it isn't. Unfortunately there's no libarchive-dev package on homebrew. A workaround for just the man pages is to download the libarchive sourcecode for the version which is installed (tar --version) and copy the man pages over: ...


2

Man section 5 is "File Formats and Conventions" and is not installed by default. see What do the numbers in a man page mean? To install part of it on a Debian system, install: sudo apt-get install libarchive-dev From packages.debian.org: Package: libarchive-dev (3.1.2-11+deb8u1) The libarchive library provides a flexible interface for reading ...


2

You can create the service without any additional apps Open Terminal, 1 Create a file by writing touch vm.command 2. Edit the file vi vm.command 3. Press "i" button, then enter the following lines: VBoxHeadless --startvm vmname (make sure you've replaced "vmname" with actual name) 4.save the file by pressing Esc button, then typing :wq 5.allow ...


2

You can't use the plugin portions of this package at this time, as a non-admin user. You and I both know that is a security risk, and others may know it is not necessary, but that is the answer. I verified that what you mentioned before about sudo was correct, and as well, there were no unix-level tweaks I could work out. I agree it would be cool if in ...


2

apt-get is part of the Debian (or Ubuntu, etc), package apt. Either you're not using one of those systems, or you haven't that package. OSX has an apt package (with MacPorts). It is not something that you are likely to have installed on your computer. You could install elinks with MacPorts or homebrew. But you will need a different tutorial. (In any ...


2

That represents IPv6, In short form it is, 2a00:1288:110:2::4001, which represents 2a00:1288:0110:0002:0000:0000:0000:4001 in long form.


1

Your machine hostname is not resolvable from the remote host. You should do this the other way round. From your local host: scp xyz@remote:/home/user/test /home/user Or the other way is to set up remote port forwarding, so you will be able to connect from your remote machine to your local host. Your command can look like this: [local] $ ssh -R 2222:...


1

What you're seeing with ctlt is a summary of the running process information, not dd's output. dd does not output any progress information, unlike what you seem to expect. If you want to see the actual progress from another terminal window, look at the output file size changing. In this case you're writing to a raw disk, so patience is probably your ...


1

It seems that your file was created using superuser sudo (root/admin) attributes so, in order to modify o delete this file you would need to authenticate as a sudo, to do this simply type: sudo rm -rf path/to/file here rm -rf stands as remove recursively so that if path/to/file is a folder all its content will be removed. Your machine will ask you for ...


1

Here you are: ifconfig -a | grep -e "inet [0-9]" | cut -d" " -f 2 Most of the given answers won't work well on Mac OS X! The easiest thing you can do, is using cut or awk.


1

Use ip addr show with -o flag. For instance, here's all IPv4 addresses of my connected interfaces $ ip -4 -o addr show | awk '{print $4}' 127.0.0.1/8 10.42.0.1/24 192.168.0.78/24 10.0.3.1/24 Getting only specific addresses that start with 10. like you have can be done this ...


1

To get all inet IP: ifconfig -a | grep -oP 'inet \K\S+' In order to get just 10.16 family: ifconfig -a | grep -oP 'inet \K10\.16\S+'


1

If you have VMware Fusion installed on your Mac one solution could be going to the selected Virtual Machine Settings and check both Accelerate 3D Graphics (Which requires VMware Tools installed on that virtual machine) and Use full resolution for Retina display (To enable Retina display support in selected virtual machine) in Display Setting. BTW, Here's ...


1

As an alternate solution, you might try splitting your .bash_profile into a portable part and a system-specific part. In your main .bash_profile add the following: if [ -f ~/.bash_profile_local ] ; then . ~/.bash_profile_local fi Then put any customizations that apply only to a given system into .bash_profile_local on that system. If you have no ...


1

The BSD install found on OpenBSD systems has this piece of code in it (from src/usr.bin/xinstall/xinstall.c): if (!S_ISREG(to_sb.st_mode)) errc(1, EFTYPE, "%s", to_name); This emits the error install: /dev/fd/4: Inappropriate file type or format when it's discovered that /dev/df/4 is not a regular file. (There's a separate earlier check for /dev/...


1

tmux (like GNU screen) works by translating the features of your actual terminal into an (often different) internal terminal. They do this to allow you to connect a session on different terminals at the same time, or at different times. When that works well, you will see the "same" text no matter where you are connecting from. Not all terminals support ...


1

To change the memory and file limits for the current shell, use ulimit (see: help ulimit). E.g. ulimit -Sn unlimited && ulimit -Sl unlimited To make it persistent, add above commands into your shell rc files (e.g. ~/.bashrc). For processes if you've reach the hard limit and you've got this error: ulimit: max user processes: cannot modify ...


1

First use DD to make the usb bootable with kali. Then use gparted and use the remaining to create the other partitions on your device. Then, you should put boot flag on the partition with kali.


1

The usual method is (writing from memory): NEWBACKUP=`date +%s` # or some other format cp -al "$OLDBACKUP" "$NEWBACKUP" rsync -aH --delete "$SOURCE" "$NEWBACKUP" Check out Easy Automated Snapshot-Style Backups with Linux and Rsync There is also a --link-dest option to rsync that I've never investigated properly.


1

You should not have to manually set MANPATH on a Mac. Unlike most Unix-based systems, OS X automatically selects an appropriate search path for man pages based on the contents of PATH. The rules for this are described in the section "Search Path for Manual Pages" in manpath(1). The configuration file for this has been in other locations in the past, but ...



Only top voted, non community-wiki answers of a minimum length are eligible