Equivalent Mac "cp -X" on Linux [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm migrating some bash scripts written for Mac to Linux, in which cp -X is used in several places. Some research shows that cp -X on Mac is different from cp -x on Linux.
The first one means "Do not copy Extended Attributes (EAs) or resource forks" while the latter means "stay on this file system".
So is there an equivalent Mac "cp -X" on Linux?
Thanks in advance:)

cp on Linux doesn't copy xattrs by default, and Linux doesn't have resource forks at all.
Thus, you don't need it -- default behavior does what you want.
However, if you want to be completely explicit:
cp --no-preserve=xattr

Related

Where do we have to put a linux command? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I just coded a script in bash on Ubuntu but I don't know where I should put it...
I read I had to put it in /usr/bin in a tutorial but maybe it's better directly in /bin ?
This is the difference between both directories:
/bin
It contains commands that can be used by both the system administrator and the users, but which are necessary when other file systems are not mounted (for example, in single user mode). It can also contain commands that scripts use indirectly
/usr/bin/
This is the main directory of executable commands in the system.
Therefore, it will work on both, but you must establish what responsibility your script has.

Why does the default shell in OS X 10 look differently than that in Linux (Mint, Lubuntu...)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
To clarify, when entering the default shell in OS X it appears as:
pcname:~ username$
and changing directories appears as:
pcname:myFolder~ username$
however, in my experience with linux distros, the shell appears as:
username#pcname:~$
what is the purpose for the differences in syntax?
What I do is the following: On the system that has the promt the way I want it, I type:
echo $PS1
I copy the result, say, \u#\h \w\a \$ and then edit the ~/.bashrc on the system that I want to use with the line:
export PS1="\u#\h \w\a \$ "
And then I get the same prompt on that system as well.
If you want to get creative, have a look here

unlimited scrolling up from default linux command line [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am looking to increase the default size of the scrolling up buffer from linux command line. It is a Debian server without gui.
I don't find related option in bashrc and I don't even know if there is other configuration file for the default prompt alt+f1 alt+f2 ...
You can change the scrollback-buffer size using kernel options as described here: https://wiki.archlinux.org/index.php/Scrollback_buffer .
However, if you are interested in the output of a command but at the same time you want to watch the command's progress interactively I suggest to use tee:
command | tee out.file
or if you want to append to a file use
command | tee -a out.file
tee is nice! use it! :)

Difference between cp and cp -p -i [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am using cp command in my program to make a copy of a text file. But when I use -p -i with cp I don't understand the difference between the both.
What's the difference between using simple cp and using options -p -i with it?
Here is my line code:
execl("/bin/cp","cp","-p","-i",argv[1],argv[2],NULL);
The -i stands for interactive mode, this will require input from the stdin before it will overwrite a file.
The -p (no capital p) will preserve mode ownership and timestamp. The latter one seems the more interesting one, this will actually cause a difference in your mss. When you're copying a file there is an owner of the file and there are different file permissions and a timestamp attached to it, if you want to keep these then use the -p parameter.

Shell script to get the OS version [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to write a shell script that will show me the OS version. I am using Linux Ubuntu 14.
How can i write a shell script that will show me the OS version?
Simply use lsb_release:
$ lsb_release -sr
12.04
See the man page for all available options. Note that not all platforms or Linux distributions have lsb_release.
Parse the output of uname:
#!/bin/bash
uname -s
and Bob's your uncle. Let me know if this helps.

Resources