Reuse the `apt up` part of the `apt update` and `apt upgrade` commands to execute both in sequence in just one line
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
How to reuse the apt up
part of the apt update
and apt upgrade
commands to execute both commands in sequence in just one line without an alias.
Something like: apt update,grade
.
command-line apt bash upgrade updates
add a comment |Â
up vote
1
down vote
favorite
How to reuse the apt up
part of the apt update
and apt upgrade
commands to execute both commands in sequence in just one line without an alias.
Something like: apt update,grade
.
command-line apt bash upgrade updates
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
How to reuse the apt up
part of the apt update
and apt upgrade
commands to execute both commands in sequence in just one line without an alias.
Something like: apt update,grade
.
command-line apt bash upgrade updates
How to reuse the apt up
part of the apt update
and apt upgrade
commands to execute both commands in sequence in just one line without an alias.
Something like: apt update,grade
.
command-line apt bash upgrade updates
command-line apt bash upgrade updates
edited 2 mins ago
Melebius
3,99051736
3,99051736
asked 30 mins ago


e200
638
638
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):
for i in date,grade; do
apt up$i
done
The smart way is to make an alias in ~/.bashrc
for these two commands and forget about retyping it ever again:
alias upgrade=' apt update && apt upgrade'
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
2
Just do the for loop in one line.for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute anapt update && apt upgrade
rather then anfor i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):
for i in date,grade; do
apt up$i
done
The smart way is to make an alias in ~/.bashrc
for these two commands and forget about retyping it ever again:
alias upgrade=' apt update && apt upgrade'
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
2
Just do the for loop in one line.for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute anapt update && apt upgrade
rather then anfor i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
add a comment |Â
up vote
2
down vote
The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):
for i in date,grade; do
apt up$i
done
The smart way is to make an alias in ~/.bashrc
for these two commands and forget about retyping it ever again:
alias upgrade=' apt update && apt upgrade'
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
2
Just do the for loop in one line.for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute anapt update && apt upgrade
rather then anfor i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):
for i in date,grade; do
apt up$i
done
The smart way is to make an alias in ~/.bashrc
for these two commands and forget about retyping it ever again:
alias upgrade=' apt update && apt upgrade'
The simple way is via for loop (on one line but here it's shown in multiple lines for clarity):
for i in date,grade; do
apt up$i
done
The smart way is to make an alias in ~/.bashrc
for these two commands and forget about retyping it ever again:
alias upgrade=' apt update && apt upgrade'
edited 3 mins ago
Melebius
3,99051736
3,99051736
answered 26 mins ago


Sergiy Kolodyazhnyy
66.6k9134294
66.6k9134294
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
2
Just do the for loop in one line.for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute anapt update && apt upgrade
rather then anfor i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
add a comment |Â
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
2
Just do the for loop in one line.for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute anapt update && apt upgrade
rather then anfor i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
Thanks. Alias is a good idea, but is there a way I can do it in the terminal with just one line without use an alias?
– e200
25 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
@e200 I'm pretty sure one could do it via elaborate and obscure bash tricks but there's no practical value to doing so.
– Sergiy Kolodyazhnyy
21 mins ago
2
2
Just do the for loop in one line.
for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
Just do the for loop in one line.
for i in date,grade; do sudo apt up$i; done
– Videonauth
20 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute an
apt update && apt upgrade
rather then an for i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
You both right. But, it does not seems to be a good solution since its more easy to execute an
apt update && apt upgrade
rather then an for i in date,grade; do sudo apt up$i; done
– e200
16 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1086021%2freuse-the-apt-up-part-of-the-apt-update-and-apt-upgrade-commands-to-execut%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password