F5F Stay Refreshed Software Operating Systems Change directory with `ls` and run commands with `cd`. Use appropriate commands in sequence.

Change directory with `ls` and run commands with `cd`. Use appropriate commands in sequence.

Change directory with `ls` and run commands with `cd`. Use appropriate commands in sequence.

Pages (2): 1 2 Next
N
NERVO
Junior Member
16
10-11-2016, 10:25 PM
#1
In Ubuntu 18.04, you can achieve this by using the same command for both `cd` and `ls`. Simply run a single command like `ls -l /path/to/dir` or `cd /path/to/dir` without switching between them. This way, `ls` behaves as `cd` and vice versa.
N
NERVO
10-11-2016, 10:25 PM #1

In Ubuntu 18.04, you can achieve this by using the same command for both `cd` and `ls`. Simply run a single command like `ls -l /path/to/dir` or `cd /path/to/dir` without switching between them. This way, `ls` behaves as `cd` and vice versa.

S
Strawbaerie
Junior Member
1
10-12-2016, 03:29 PM
#2
In Bash, you can assign shortcuts like alias ls="cd" and alias cd="ls". It's a way to simplify commands. But I'm curious about why you're asking—what's the point?
S
Strawbaerie
10-12-2016, 03:29 PM #2

In Bash, you can assign shortcuts like alias ls="cd" and alias cd="ls". It's a way to simplify commands. But I'm curious about why you're asking—what's the point?

H
Hypersnake
Member
208
10-12-2016, 06:03 PM
#3
Share wisdom gently with others.
H
Hypersnake
10-12-2016, 06:03 PM #3

Share wisdom gently with others.

J
JohnnyBobo
Junior Member
3
10-12-2016, 11:19 PM
#4
I just attempted that but it didn't work.
J
JohnnyBobo
10-12-2016, 11:19 PM #4

I just attempted that but it didn't work.

R
rento113
Junior Member
42
10-14-2016, 03:18 AM
#5
You receive the results after confirming the correct bash environment. It works for you in this case.
R
rento113
10-14-2016, 03:18 AM #5

You receive the results after confirming the correct bash environment. It works for you in this case.

M
MrGoldenApple
Member
166
10-14-2016, 04:39 AM
#6
it seems the usual command isn't functioning, but changing it to alias ls='pickle' might help
M
MrGoldenApple
10-14-2016, 04:39 AM #6

it seems the usual command isn't functioning, but changing it to alias ls='pickle' might help

K
kcristan
Senior Member
514
11-01-2016, 03:03 PM
#7
they seem to be running commands independently without returning results if the directory is empty. Check the output for details. Your alias is set to cd and you're seeing the contents of /var. The shell used is bash.
K
kcristan
11-01-2016, 03:03 PM #7

they seem to be running commands independently without returning results if the directory is empty. Check the output for details. Your alias is set to cd and you're seeing the contents of /var. The shell used is bash.

Z
zFenix045_
Member
126
11-01-2016, 05:01 PM
#8
backup failures halt system logs, metrics are processed via spool, cache is loaded, mail handling active, locking mechanisms engaged, temporary storage used.
Z
zFenix045_
11-01-2016, 05:01 PM #8

backup failures halt system logs, metrics are processed via spool, cache is loaded, mail handling active, locking mechanisms engaged, temporary storage used.

R
reactscarface
Member
156
11-06-2016, 07:18 AM
#9
-bash
R
reactscarface
11-06-2016, 07:18 AM #9

-bash

H
helenma0301
Senior Member
250
11-13-2016, 05:54 PM
#10
It seems like there might be no issue with your setup. Bash aliases usually work fine.
H
helenma0301
11-13-2016, 05:54 PM #10

It seems like there might be no issue with your setup. Bash aliases usually work fine.

Pages (2): 1 2 Next