How To Create Your Own Linux Ubuntu Terminal Commands!

How To Create Your Own Linux Ubuntu Terminal Commands!

Adam Eubanks

6 лет назад

22,412 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Midoriya
Midoriya - 23.06.2023 14:39

hi

Ответить
CZghost
CZghost - 27.03.2023 13:52

What you created is essentially a shell script (those files usually have ".sh" at the end to distinguish between regular commands, which are really just ELF executables - programs - and text based scripts). If you want to create a new command, you could create a shell script like that (by default it will assume the default or running shell, which in majority of Linux distros is going to be Bash, you can change that or specify with something called "shebang", which is essentially a special comment at the top that starts with #! and immediately after - no space in between - you type in the path to the shell you want to use, and even supply arguments), and if you don't want to use the ".sh" part, you eighter create the file without it in the name, or you could create an alias that would map a command to a script file. Easily done.

Ответить
Midhun Manu
Midhun Manu - 18.02.2023 09:47

thanks

Ответить
Kalpa Online
Kalpa Online - 26.07.2022 15:28

you've explained well, keep it up. Thankyou

Ответить
Aditya Vaste
Aditya Vaste - 03.04.2022 15:20

Thanks, buddy that's what I was looking for...

Ответить
Anthony Meredith
Anthony Meredith - 25.02.2022 02:18

I'm glad I found this video, I definitely prefer it over creating an alias in my .bashrc

Ответить
DW Tostinos🎀
DW Tostinos🎀 - 04.02.2022 04:08

My boy what is that background

Ответить
Shayy 55
Shayy 55 - 23.05.2021 21:09

you've explained it well, thanks

Ответить
J_Net Reloaded
J_Net Reloaded - 26.04.2021 20:48

i been trying to compile a schript (sh) to make an executable binary for linux but it didnt work any way to make this work?> theres no error?

Ответить
ItzShinePlayz
ItzShinePlayz - 27.03.2021 20:19

Suggestions! How to Make command line/syntax like When I type help it show the info and When I type firewall it show me option to Enable or disable.

Ответить
Alex Joslin
Alex Joslin - 12.03.2021 11:24

There's an even easier way.

Open the file ".bashrc" (located in your home directory, it's a hidden folder)

Type:
alias helloworld="echo \"hello world\""
Save the document

Type in the terminal:
source .bashrc (this updates the changes on your system)

now you can use helloworld as a command.

Ответить
fantastic
fantastic - 08.01.2021 07:01

Write a utility utility called junk that satisfies satisfies the following following
specification:
• Utility: junk [-l] [-p] { fileName }* p] { fileName }*
– junk is a replacement for the rm utility.
– R h at er than removing files, it moves them into the
subdirectory ".junk" in your home directory.
– If " junk" ".junk" doesn't doesn't exist, it is automatically automatically created created.
– The ‐l option lists the current contents of the ".junk"
directory, and
– the ‐p option purges ".junk".

if u could please help me solve this

Ответить
fantastic
fantastic - 08.01.2021 06:14

hello how i can contact u?

Ответить
Cadris Silver
Cadris Silver - 15.10.2020 20:39

good

Ответить
Justus
Justus - 11.09.2020 06:23

aint unix so awsome lmao

Ответить
Fasna T.K
Fasna T.K - 28.07.2020 08:22

Hey would you please name you icon theme😅
I do just love that icons🤩

Ответить
Take Care
Take Care - 15.06.2020 07:14

Which linux distro is this?

Ответить
Sheeple Slayer
Sheeple Slayer - 28.12.2019 10:41

None of these commands are working for me.

Ответить
Job Sunday Owonubi
Job Sunday Owonubi - 16.09.2019 12:53

You are amazing.

Ответить
yzinventions
yzinventions - 12.09.2019 02:49

easier way; sudo apt install gedit: enter password and download: type: gedit .bash_aliases: when file open type: alias YOURWORD='COMMAND' : go back to terminal and type source .bash_aliases : if you don't write this after saving then it won't work ps since it is .bash_aliases the . means that its hidden witch is for if anyone finds it in your file manager they can't make it to whatever they want, for example, they can make echo do rm -rf


PS if your do rm - rf in terminal it will mess up your computer so you can't blame me for mentioning it
By taking this advice and putting it in my terminal (name of person) will not hold YZ inventions accountable if this doesn't work

Ответить