• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

[unix bash]How can I do this in one command?

imported_Stew

Golden Member
So, I want to execute these two commands as one line:

cd /usr/bin/
ls [a]*

How do I do it?
(I initially thought "ls [a]* /usr/bin/" would do it.)
 
IDK what exactly you want to do but --

This just leaves the current directory the same and runs the ls relative to the other place:
ls /usr/bin/[a]*

This runs the commands in a subshell process which then exits so your current shell's directory does not change but the sub-shell only runs ls from that changed directory:
(cd /usr/bin ; ls [a]*)

This combines the commands to one line in the current shell -- in the end your shell's in the new directory:
cd /usr/bin ; ls [a]*
 
Back
Top