Tag Info

Hot answers tagged

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 ...


3

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 ...


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 ...


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 $


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 "$@". ...


2

Using the -x option for stat should give you similar output: $ stat -x 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 ...


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 ...


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 ...


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


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 ...


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


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 ...



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