« first day (2842 days earlier)      last day (2116 days later) » 

2:07 PM
Not sure I can ask It here. I gave an interview yesterday and Interviewer asked me question " Is 'ls' a command. If yes, Explain how ? " and I was totally puzzled by it. I just explained what is 'ls' used for, and now I am confused about 'ls' being a command. Someone please enlighten me.
 
@C0deDaedalus ls is a command. They probably meant like "Is it a command or a builtin"
You can check using whatis ls
 
I executed "type" and "file" commands to know what exactly it is and came to conclusion that "It is an executable" . Would saying "ls is an executable" as an answer be right ?
 
@C0deDaedalus Yeah that is actually a good point because builtins are also technically commands
I would have just said "Yes" and then waited for them to respond lol
 
Same question was asked to my friend. He said yes and he didn't got selected.
So, technically a command can be either executable or builtin. And ls is an executable command. Right ?
 
Correct
some commands are both executables and builtins (depending on the environment) like time or echo
 
2:17 PM
I typed in " type time " and it shows ` time is a shell keyword `. Is shell keyword same as shell built-in ?
And How environment affects the type of command to be an executable or built-in ?
 
@C0deDaedalus by environment I meant shell used. I think some shells don't have echo as a builtin for example
33
A: What's the difference between shell builtin and shell keyword?

gniourf_gniourfThere's a strong difference between a builtin and a keyword, in the way Bash parses your code. Before we talk about the difference, let's list all keywords and builtins: Builtins: $ compgen -b . : [ alias bg bind break builtin caller cd c...

 
Shells, will do search on that.
 
so I stand corrected, time is a keyword not a builtin. However it's also an executable /usr/bin/time on my system
 
Yes you are correct. Sorry If I annoyed you and Thanks for the link. :)
 
2:44 PM
@C0deDaedalus Their selection may have been based on something other than the answer to that particular question.
ls is a command. Sometimes it's referred to as a utility.
Built-in commands are also commands.
while and if on the other hand, are keywords.
A shell may choose to provide any command as a built in command, even ls. So the distinction between "a command" and "a built in command" does not really matter.
time may be a keyword in one shell, but it's not standard. In fact, on my machine, I have time as a keyword, but I also have /usr/bin/time which does a similar thing.
Had the question been "is time a command?", then "yes" would have been a correct answer.
"No" would also have been a correct answer. It depends on how you use the keyword or the command.
Without context, the answer "No, 'ls' are two characters" would have been correct too :-)
 
I hate when interviewers try to give "trick" questions
 
3:00 PM
@C0deDaedalus A command can also be a shell function.
 
3:29 PM
Why is imitation crab meat even a thing
I couldn't imagine consuming any food with "imitation" in it's title
 
3:54 PM
@Jesse_b That's... a weird food disorder to have.
 
@Kusalananda Wanting to eat natural food is a disorder? Sign me up
 
4:11 PM
I just got a blackmail spam. That's a first.
 
@FaheemMitha Sorry I was bored
 
@Kusalananda Not a disorder. A preference.
@Jesse_b Comedy hour, apparently.
I wonder what statistical success rates spam messages have. Quite low but presumably non-zero.
 
@FaheemMitha Old people believe everything they see
 
@Jesse_b But don't necessarily act on it. And not all old people.
 
@FaheemMitha Most of them do
If you call my grandmother and say you are a charity she will give you money
 
5:00 PM
@Jesse_b And she can figure out how to send people money? If so, I'm impressed.
 
5:48 PM
@FaheemMitha The point of the bad writing in most spam messages is to be badly written enough that only people dumb enough to be easily defrauded will believe them.
 
6:00 PM
@JennyD Yes, I'm aware of that.
 
6:16 PM
Hello everyone
 
6:30 PM
Hi @PrabhjotSingh
 
@FaheemMitha hello, how are you?
 
@PrabhjotSingh Hah. You know the answer.
 
@FaheemMitha still alive? I'm a victim of habit.
 
@PrabhjotSingh Exactly.
I hope you're having a good weekend. Or trying to.
 
Yes, week has been very busy. Plus my PC was without gui.
 
6:39 PM
@PrabhjotSingh oh?
 
BTW bought new PC. i3
 
@PrabhjotSingh Oh. What PC was that?
 
I will send lscpu output you tomorrow.
 
@PrabhjotSingh No, I just meant, what model did you buy? Or did you have it custom made? In most cases, it makes more sense to custom make it.
And in India, it's quite cheap, relatively.
 
@FaheemMitha this is custom made. Hold your horses I will tell everything tomorrow.
 
6:49 PM
@PrabhjotSingh Why not tell me now?
 

« first day (2842 days earlier)      last day (2116 days later) »