Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The '-X' option executes screen commands. 'ls' isn't a screen command, but stuff is. The argument to stuff is then a string which gets stuffed into the specified session. I use this method quite a bit to launch interactive applications at boot time.
Aha ok... And what should I put at the end of the string for it to execute the command, since using just "stuff ls" it just sends the string without executing it?
Where can I find all the options for each unix command? Because I'm trying to understand what the "ls -las" and "echo -ne" do, but can't find reference to those options in the man pages, or the internet for that matter... I'm still new around here.
What documentation should I look for, to see what is that "\015"?
Where can I find all the options for each unix command? Because I'm trying to understand what the "ls -las" and "echo -ne" do, but can't find reference to those options in the man pages
The man pages are a great reference, but it can take a while to get used to reading them. I'm suspecting that in this case you are having trouble since you may be looking for an "-las" option in the "ls" manpage. However, there is no "-las" option. It is simply the "-l", "-a" and "-s" options combined.
Quote:
What documentation should I look for, to see what is that "\015"?
To explain the immediate question, because there is a fair bit of obscuratta there:
\015 is the octal value of 'newline'/'carriage return'. Putting it in single quotes makes the backslash into not-an-escape, so it denotes a single byte, in octal radix. It is echoed without appending a newline (-ne), which sounds completely redundant, but I think I found it had be like that, and I don't understand why. The output of echo is turned into a commandline argument using the magic of `backticks` and which should be replaced with the preferred $(not_backticks_anymore) notation. It gets appended to the commandline, as the final character of the stuff argument. The double quotes would be unnecessary, if we just wanted the bare ls command, but I like my ls a bit fancier.
The good news is, you aren't likely to bump into anything much weirder than this. Possible, but not often. Screen itself is a bit of an odd thing (but a very useful one), and everything around it seems to be a bit on the fringe, too.
The man pages are great for finding out what existing commands do, but not so much for figuring out what to use to solve your problems. For that, experience is the best reference. And Google. A lot of commands are built into the shell, and for those you'll get dumped into the bash manpage, left to find the particular command on your own. There is also the somewhat arcane 'info' pages, which require some learning to get around the system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.