Tag Info

New answers tagged

1

Using the -x option for stat should give you similar output: $ stat foo File: "foo" Size: 0 FileType: Regular File Mode: (0644/-rw-r--r--) Uid: ( 501/ Tyilo) Gid: ( 0/ wheel) Device: 1,4 Inode: 8626874 Links: 1 Access: Mon Dec 22 06:17:54 2014 Modify: Mon Dec 22 06:17:54 2014 Change: Mon Dec 22 06:17:54 2014 To make ...


2

The stat command that you saw from “everyone on the internet” is the one from GNU coreutils, which is found on non-embedded Linux and Cygwin. It could also be the one from BusyBox, which is commonly found on embedded Linux. OSX has a different stat utility (the one from FreeBSD/NetBSD/OpenBSD), with a similar purpose but different options and a different ...


9

I think this should do it: tar -xzf file.tar.gz -C ~/locationX folder1 -C ~/locationY folder2 The -C option means to change to the specified directory before doing the extraction. Specifying filename arguments after the tarfile name restricts the extraction to just those files or directories. And you can repeat this -Changing directories as you do. Note ...


1

I don't do the whole mac thing anymore, so I don't have anything to test with, but in the quest to get this working on FreeBSD, I managed to figure out how to get this working from ports. I recall OSX has stuff like brew and macports - Try installing the GNU coreutils from this if you really want dircolors to work. I also had to set an alias for dircolors to ...


0

As @G-Man commented, you [ can't read directories as file When did directories stop being readable as files?; Instead, to find i-node numbers, you could use stat ➜ stat -x . File: "." Size: 1632 FileType: Directory Mode: (0755/drwxr-xr-x) Uid: ( 501/ barisa) Gid: ( 20/ staff) Device: 1,2 Inode: 5431597 Links: 48 ...


0

I'm using Yosemite, I have a feeling things have changed from previous versions. Like @pixelass I had to put the ulimit settings in my ~/.bash_profile. I tried the other answer of putting it in my /etc/profile (had to chmod +w it) but I get these errors on login. Last login: Fri Dec 12 10:54:32 2014 from 192.168.2.4 -bash: ulimit: open files: cannot modify ...


0

Would you mind expanding on how you "using OS X recovery to bless the grubx64.efi file"? I booted from an OS X installation SD card, started a terminal but was not able to mount the fat32 EFI partition. I tried mount -t exfat /dev/disk1s1 /Volumes/xxx but it came back saying "Invalid argument". I also tried -t msdos to no avail.


1

Adding entries to your .bashrc for settings to survive a powercycle (or just logout and login) is good practise, but both your examples have problems: export http_proxy=http://proxy:8080 export ALL_PROXY=$http_proxy only sets and exports http_proxy on the first application: $ export http_proxy=http://proxy:8080 export ALL_PROXY=$http_proxy $ echo ...


0

in bash v=foo-bar && v=$(IFS=- read -ra x <<<"$v"; printf '%s' "${x[*]^}") && printf '%s\n' "$v" Foo Bar In python v=foo-bar python -c 'import os, string print string.capwords(" ".join(os.environ["v"].split("-"))) ' Foo Bar


2

That is not a bash error, but a python error, since the corresponding line in that script is: echo "Start packager (may take some time)"; sudo /usr/local/packager/packager.py install $TYPE-frontenddev


2

For the splitting in a POSIX shell you could do: set -f; IFS=-; set -- $1; IFS=' ' There - now all of your dashes are spaces and you can have the entire string in "$*" or else each space - previously dash - separated string in $1 $2 $3 ... (the total count of which is available to you in "$#") or you can get them as an expandable argument list in "$@". ...


1

Step 1: Replace the - with a space For this you can use tr command as follows: tr "-" " " Step 2: Make first letter of every word capital For this, you can find the word boundary using \b and make immediate letter capital. The . represents immediate letter after word boundary \b, \U makes it capital and & will keep all other letters in the letters as ...


2

Start by changing dashes to spaces, like: sed 's/-/ /g' Uppercasing the first letter is already solved (go upvote them; or just mark this question a duplicate of that one). Then combine them: sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' $ echo "foo-bar-baz-nonce" | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' Foo Bar Baz Nonce $


1

One solution using perl, not restricted to only `foo-bar` $ cat file aaa-zzz-eee-rrr foo-bar code $ perl -ne 'print join " ", map { ucfirst } split /-/' file Aaa Zzz Eee Rrr Foo Bar Another solution using pure bash while IFS='-' read -r -a words; do printf '%s\n' "${words[@]^}" | paste -sd ' ' done < file Output: Aaa Zzz Eee Rrr Foo Bar


0

If that string is part of a file or output: sed 's/foo-bar/Foo Bar/g' file Assuming there are no "strange" characters in the string (/, \, &): string="foo-bar" set -- $(echo "${string//-/ }") replstr="$(for word in $*; do echo -n "${word^} "; done)" replstr="${replstr% }" sed "s/${string}/${replstr}/g' file


0

This appears to work: # VBoxManage hostonlyif remove vboxnet0 This removes the host-only network. Then restarting VirtualBox brought the interface back and it works. For now. Honestly, I don't know if I've actually found the solution or if it's just dumb luck and it will stop working in a few minutes.


1

Not exactly the answer you asked for, but you should be able to transfer files through an SSH connection: sending ssh user1@firewall "ssh user2@cluster \"cat > remote_file\" " < local_file fetching ssh user1@firewall "ssh user2@cluster \"cat remote_file\" " > local_file EDIT: There are also terminal based file transfer tools like ...


0

Read about Reverse SSH. Maybe this will help you. I use it to connect to remote storages behind NAT.


0

I guess you should separate the file handling from the directory handling. Make the directories first. In the GNU world: cd /dir2 find /dir -mindepth 1 -maxdepth 1 -type d -exec mkdir {} \; And then the symlinks: find /dir -mindepth 1 -maxdepth 1 -type f -exec ln -s -t /dir2 {} +


3

The premise is unprovable. Science requires a falsifiable hypothesis; there is no way to test any of the likely counterhypotheses, such as that Windows would crash less if Apple wrote all of the drivers instead, or that Windows would be more stable if Microsoft somehow cut off support for a vast chunk of the existing supported hardware space. You'd basically ...


1

The "solution" you mention is a really bad one (it can't deal with weird file names for example) and completely unnecessary. Just use diff directly: diff -r "$PATH1" "$PATH2" That will recursively (-r) compare the directories and report whether files are present or missing. For example: $ tree . ├── dirA │   ├── file1 │   └── file2 └── dirB └── ...


1

You may be able to run it under PureDarwin using VirtualBox. "Darwin is the Open Source operating system from Apple that forms the basis for Mac OS X, and PureDarwin is a community project to make Darwin more usable (some people think of it as the informal successor to OpenDarwin)." http://www.puredarwin.org/developers/virtualbox#TOC-Ubuntu-Virtual-Box-4


0

You might have luck with Darling: Darling is a translation layer that allows you to run unmodified OS X binaries on Linux. In its nature, it is similar to the well-known Wine project. At this point, it is unlikely that Darling will run your favorite OS X application. For more information, review the Project Status. Developers are always welcome to join ...


0

.bash_profile is only loaded if bash is started as a login shell. On OSX, the default is to start a login shell in every terminal, so that's the common case for you. But if you ever type bash to run a nested shell, or run screen or tmux, or anything else that starts an interactive shell, you'll end up with an interactive, non-login shell. This shell only ...


0

There is some conflict in the directory is the reason for the cause. $ /opt/cmake/bin/cmake -version With the help of the above command you can try whether the Cmake has downloaded properly or not. Else try installing in different location.


0

What I found to be a good solution for me was Ziproxy. It's an http compression proxy that is able to compress big html assets, like images, so that webpages are lighter. As it's a proxy, it works with or without a VPN. It's also very easy to configure.


0

You need an EFI bootable USB stick, no matter what distribution you plan to use. For example Porteus distribution offers it out of the box. So all you need to do is following: Go to Porteus Download section and select 64 bit varian and EFI support; rest can be default. Download your ISO image. Copy the content of the image to your USB stick. Run the ...


0

You should be using -exec here: find . \( -name '*.mp4' -o -name '*.mkv' -o -name '*.avi' \) \ -exec sh -cf 'IFS=._ for f do d=${f%/*} f=${f##*/} [ -n "${f##*_*}" ] && continue set -- $f printf "%s\n" "mv \\" "$d/$f \\" "$d/$*" done' find.rename.shc {} + As written this only prints the command it will execute if you go ...


0

Fixed. Spent a couple hours on phone with VMWare support (they are awesome BTW). Tried all manner of things, then I noticed a similar error in /var/log/system.log from smbfs. re-applied the 10.10.1 update, and everything works.


0

Figured it out. Here is my functional script: #!/bin/bash ADMIN_PASS="$(cat /Users/adminuser/Documents/UpdateScript/enPass.txt)" ADMIN_USER="adminuser" HOST_LIST="/Users/adminuser/Desktop/hosts.txt" for HOST in $(< $HOST_LIST); do echo "" echo "--------------------------------" echo "# CONNECTING TO: $HOST #" echo ...


0

You need to add a pid_file and sig_num to dnsmasq.conf like so: # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/dnsmasq.log nobody:admin 640 5 10000 * Z /var/run/dnsmasq.pid 31 sig_num 31 is SIGUSR2 which will tell dnsmasq to close and reopen its log file.



Top 50 recent answers are included